This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jhshi89
Recipients asvetlov, jhshi89, yselivanov
Date 2021-02-19.06:47:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613717279.64.0.759786918974.issue43262@roundup.psfhosted.org>
In-reply-to
Content
One of our asyncio based application sporadically crash due to this stack trace:

```
File ".../lib/python3.8/asyncio/runners.py", line 48, in run
    loop.run_until_complete(loop.shutdown_asyncgens())
  File ".../lib/python3.8/asyncio/base_events.py", line 595, in run_until_complete
    future = tasks.ensure_future(future, loop=self)
  File ".../lib/python3.8/asyncio/tasks.py", line 669, in ensure_future
    task = loop.create_task(coro_or_future)
  File ".../lib/python3.8/asyncio/base_events.py", line 431, in create_task
    task = tasks.Task(coro, loop=self, name=name)
  File ".../lib/python3.8/_weakrefset.py", line 83, in add
    self._commit_removals()
  File ".../lib/python3.8/_weakrefset.py", line 56, in _commit_removals
    discard(l.pop())
IndexError: pop from empty list
```

We do not have a reliable repro. From reading the source code, it appears we should never try to pop from empty list:

```
 def _commit_removals(self):
        l = self._pending_removals
        discard = self.data.discard
        while l:
            discard(l.pop()) # <-- HERE
```
History
Date User Action Args
2021-02-19 06:47:59jhshi89setrecipients: + jhshi89, asvetlov, yselivanov
2021-02-19 06:47:59jhshi89setmessageid: <1613717279.64.0.759786918974.issue43262@roundup.psfhosted.org>
2021-02-19 06:47:59jhshi89linkissue43262 messages
2021-02-19 06:47:59jhshi89create