Merge pull request #1055 from youknowone/cancel-timeout
Cancel request tasks when response timeout is triggered
This commit is contained in:
commit
19466a15b4
|
@ -174,6 +174,10 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
self.response_timeout_callback)
|
self.response_timeout_callback)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
if self._request_stream_task:
|
||||||
|
self._request_stream_task.cancel()
|
||||||
|
if self._request_handler_task:
|
||||||
|
self._request_handler_task.cancel()
|
||||||
try:
|
try:
|
||||||
raise ServiceUnavailable('Response Timeout')
|
raise ServiceUnavailable('Response Timeout')
|
||||||
except ServiceUnavailable as exception:
|
except ServiceUnavailable as exception:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user