classification
Title: AttributeError: 'Task' object has no attribute '_callbacks'
Type: behavior Stage: resolved
Components: asyncio Versions: Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Timur Irmatov, asvetlov, yselivanov
Priority: normal Keywords:

Created on 2018-01-24 16:44 by Timur Irmatov, last changed 2018-05-29 17:00 by yselivanov. This issue is now closed.

Messages (3)
msg310616 - (view) Author: Timur Irmatov (Timur Irmatov) Date: 2018-01-24 16:44
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?
msg310617 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-01-24 16:45
Can you check if this happens on 3.6?  3.5 is in a security-fix mode only, so even if this is a bug it would take us a long time to fix it.
msg318060 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-05-29 17:00
Closing this one as I believe it's fixed in all versions.
History
Date User Action Args
2018-05-29 17:00:27yselivanovsetstatus: open -> closed
resolution: out of date
messages: + msg318060

stage: resolved
2018-01-24 16:45:36yselivanovsetmessages: + msg310617
2018-01-24 16:44:23Timur Irmatovcreate