Issue 32653: AttributeError: 'Task' object has no attribute '_callbacks' (original) (raw)
Sometimes during shutdown of our simple http server based on asyncio/ aiohttp we get following stack trace:
ERROR [2018-01-24 08:28:33,398]: Exception in default exception handler while handling an unexpected error in custom exception handler Traceback (most recent call last): File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1293, in call_exception_handler self._exception_handler(self, context) File "/opt/alt/python35/bin/imunify360-captchaserver", line 640, in _error_handler loop.default_exception_handler(context) File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1256, in default_exception_handler value = repr(value) File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 213, in repr info = self._repr_info() File "/opt/alt/python35/lib64/python3.5/asyncio/tasks.py", line 96, in _repr_info info = super()._repr_info() File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 205, in _repr_info if self._callbacks: AttributeError: 'Task' object has no attribute '_callbacks'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1301, in call_exception_handler 'context': context, File "/opt/alt/python35/lib64/python3.5/asyncio/base_events.py", line 1256, in default_exception_handler value = repr(value) File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 213, in repr info = self._repr_info() File "/opt/alt/python35/lib64/python3.5/asyncio/tasks.py", line 96, in _repr_info info = super()._repr_info() File "/opt/alt/python35/lib64/python3.5/asyncio/futures.py", line 205, in _repr_info if self._callbacks: AttributeError: 'Task' object has no attribute '_callbacks'
Is this some bug or consequence of our code not cancelling/ waiting for all coroutines?