Cancel request tasks when response timeout is triggered
Before: Even after raising ResponseTimeout, server still processes remaining tasks until it is done After: Before raising ResponseTimeout, server stops working task.
This commit is contained in:
parent
72254a7af9
commit
d54b406cba
|
@ -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