mirror of
https://github.com/django/daphne.git
synced 2025-04-20 00:32:09 +03:00
catch asyncio.CancelledError as well as concurrent.futures.CancelledError
as of [bpo-32528](https://bugs.python.org/issue32528), asyncio.CancelledError is not a subclass of concurrent.futures.CancelledError. This means that if an asyncio future raises an exception, it won't be caught. Therefore, the exception will bubble past the try-except within the loop in application_checker, resulting in done applications not being cleaned up, and the application_checker task not being queued again.
This commit is contained in:
parent
a69723ca3f
commit
7225fa7245
|
@ -277,7 +277,7 @@ class Server(object):
|
|||
if application_instance and application_instance.done():
|
||||
try:
|
||||
exception = application_instance.exception()
|
||||
except CancelledError:
|
||||
except (CancelledError, asyncio.CancelledError):
|
||||
# Future cancellation. We can ignore this.
|
||||
pass
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user