You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Protect tasks weak set manipulation in asyncio.all_tasks() #79151
Traceback (most recent call last):
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\threading.py", line 917, in _bootstrap_innerself.run()
File "D:\Proj\antwork\code\antwork_backend\server\data_handlers\order\playback_hd.py", line 147, in run
send_to_ws(channel=self.room_name, data=json.loads(msg))
File "D:\Proj\antwork\code\antwork_backend\server\data_exchange.py", line 26, in send_to_ws
asyncio.run(channel_layer.group_send(channel, send_data))
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\asyncio\runners.py", line 46, in run
_cancel_all_tasks(loop)
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\asyncio\runners.py", line 54, in _cancel_all_tasks
to_cancel = tasks.all_tasks(loop)
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\asyncio\tasks.py", line 38, in all_tasksreturn {t for t in _all_tasks
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\asyncio\tasks.py", line 38, in <setcomp>return {t for t in _all_tasks
File "C:\Users\max\AppData\Local\Programs\Python\Python37\lib\_weakrefset.py", line 61, in __iter__for itemref inself.data:
RuntimeError: Set changed size during iteration
changed the title [-]Protect all_tasks manipulation in asyncio.all_tasks()[/-][+]Protect tasks weak set manipulation in asyncio.all_tasks()[/+]on Oct 13, 2018
3.7.1rc2 is about to be released so to add this would require retagging and remanufacturing release bits. If the chances of it happening are "very low", I would prefer to not further delay rc2. If you and Yury agree that the risk is low and the benefit is high, we could consider risking cherry-picking it to 3.7.1 final. Sound OK?
> we could consider risking cherry-picking it to 3.7.1 final. Sound OK?
Let's wait for Yuri opinion.
I agree it's a pretty serious bug; basically a time bomb that can crash a perfectly fine asyncio application. The PR itself seems to be safe to cherry-pick to 3.7.1 even after rc2. I suggest to merge it asap though to have some time for buildbots to test it.
New changeset 97cf082 by Miss Islington (bot) (Andrew Svetlov) in branch 'master': bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) 97cf082
New changeset 5dbb1b7 by Andrew Svetlov (Miss Islington (bot)) in branch '3.7': bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849) 5dbb1b7
New changeset 60c663c by Ned Deily (Miss Islington (bot)) in branch '3.7': bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849) 60c663c
Activity
asvetlov commentedon Oct 13, 2018
416c1eb#commitcomment-30887909
[-]Protect all_tasks manipulation in asyncio.all_tasks()[/-][+]Protect tasks weak set manipulation in asyncio.all_tasks()[/+]asvetlov commentedon Oct 13, 2018
The issue is hard to reproduce, the problem happens on an implicit garbage collector run during iteration over
_all_tasksweakset.asvetlov commentedon Oct 13, 2018
Ned, would be nice to have this trivial bugfix in 3.7.1.
The problem happens if wakes up on weakset iteration.
The chance is very low, it leads to a flaky scary bug.
ned-deily commentedon Oct 13, 2018
3.7.1rc2 is about to be released so to add this would require retagging and remanufacturing release bits. If the chances of it happening are "very low", I would prefer to not further delay rc2. If you and Yury agree that the risk is low and the benefit is high, we could consider risking cherry-picking it to 3.7.1 final. Sound OK?
asvetlov commentedon Oct 13, 2018
Let's wait for Yuri opinion.
1st1 commentedon Oct 13, 2018
I agree it's a pretty serious bug; basically a time bomb that can crash a perfectly fine asyncio application. The PR itself seems to be safe to cherry-pick to 3.7.1 even after rc2. I suggest to merge it asap though to have some time for buildbots to test it.
miss-islington commentedon Oct 13, 2018
New changeset 97cf082 by Miss Islington (bot) (Andrew Svetlov) in branch 'master':
bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837)
97cf082
asvetlov commentedon Oct 13, 2018
New changeset 5dbb1b7 by Andrew Svetlov (Miss Islington (bot)) in branch '3.7':
bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849)
5dbb1b7
asvetlov commentedon Oct 13, 2018
Ned, the fix has landed on both master and 3.7
Your turn, please.
ned-deily commentedon Oct 13, 2018
Thanks, Andrew and Yury! Just leave the issue open as a "release blocker" for now and I will take care of it for 3.7.1 final.
asvetlov commentedon Oct 13, 2018
Cool!
Thanks, Ned
ned-deily commentedon Oct 20, 2018
New changeset 60c663c by Ned Deily (Miss Islington (bot)) in branch '3.7':
bpo-34970: Protect tasks weak set manipulation in asyncio.all_tasks() (GH-9837) (GH-9849)
60c663c
ned-deily commentedon Oct 20, 2018
Released in 3.7.1