Skip to content
Snippets Groups Projects
Commit 6c48aa02 authored by Erik Johnston's avatar Erik Johnston
Browse files

Run canceller first to allow it to generate correct error

parent 6bbe3d57
No related branches found
No related tags found
No related merge requests found
...@@ -421,11 +421,14 @@ def timeout_deferred(deferred, timeout, reactor, on_timeout_cancel=None): ...@@ -421,11 +421,14 @@ def timeout_deferred(deferred, timeout, reactor, on_timeout_cancel=None):
def time_it_out(): def time_it_out():
timed_out[0] = True timed_out[0] = True
try:
deferred.cancel()
except: # noqa: E722, if we throw any exception it'll break time outs
logger.exception("Canceller failed during timeout")
if not new_d.called: if not new_d.called:
new_d.errback(DeferredTimeoutError(timeout, "Deferred")) new_d.errback(DeferredTimeoutError(timeout, "Deferred"))
deferred.cancel()
delayed_call = reactor.callLater(timeout, time_it_out) delayed_call = reactor.callLater(timeout, time_it_out)
def convert_cancelled(value): def convert_cancelled(value):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment