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.

Title: asyncio: race condition with debug and subprocess
Type: Stage: resolved
Components: asyncio Versions: Python 3.7, Python 3.6, Python 3.4, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, miss-islington, ned.deily, wg, yselivanov
Priority: normal Keywords: patch

Created on 2017-06-29 17:40 by wg, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2490 closed wg, 2017-06-29 17:40
PR 7545 merged yselivanov, 2018-06-08 21:35
PR 7547 merged miss-islington, 2018-06-08 22:25
PR 7548 merged miss-islington, 2018-06-08 22:26
Messages (5)
msg297289 - (view) Author: William Grzybowski (wg) * Date: 2017-06-29 17:40
If a process is schedule to run in the event loop with debug disabled
and debug is then enabled before the process finishes it will result in
a traceback: debug_log undefined.

[2017/06/29 14:39:13] (ERROR) asyncio.default_exception_handler():1261 - Ta
sk exception was never retrieved
future: <Task finished coro=<kmod_load() done, defined at /usr/local/lib/py
thon3.6/site-packages/middlewared/plugins/> exception=UnboundLocal
Error("local variable 'debug_log' referenced before assignment",)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/",
line 503, in kmod_load
    kldstat = (await (await Popen(['/sbin/kldstat'], stdout=subprocess.PIPE
  File "/usr/local/lib/python3.6/asyncio/", line 225, in creat
    stderr=stderr, **kwds)
  File "/usr/local/lib/python3.6/asyncio/", line 1194, in sub
process_exec'%s: %r', debug_log, transport)
msg319105 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-06-08 20:32
@yselivanov, @asvetlov: ping on the languishing PR
msg319113 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) Date: 2018-06-08 22:24
New changeset 12f482e0ae33021c04264294f33fa6baa9617cec by Yury Selivanov in branch 'master':
bpo-30805: Avoid race condition with debug logging (GH-7545)
msg319114 - (view) Author: miss-islington (miss-islington) Date: 2018-06-08 22:42
New changeset 21f4c780a1de99bdb37abf57445f0c942449b45b by Miss Islington (bot) in branch '3.7':
bpo-30805: Avoid race condition with debug logging (GH-7545)
msg319115 - (view) Author: miss-islington (miss-islington) Date: 2018-06-08 22:47
New changeset 234b53f8b5d0615051025be26cf8adecbc346c57 by Miss Islington (bot) in branch '3.6':
bpo-30805: Avoid race condition with debug logging (GH-7545)
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 74988
2018-06-08 22:53:34yselivanovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-06-08 22:47:47miss-islingtonsetmessages: + msg319115
2018-06-08 22:42:09miss-islingtonsetnosy: + miss-islington
messages: + msg319114
2018-06-08 22:26:48miss-islingtonsetpull_requests: + pull_request7181
2018-06-08 22:25:56miss-islingtonsetpull_requests: + pull_request7180
2018-06-08 22:24:40yselivanovsetmessages: + msg319113
2018-06-08 21:35:58yselivanovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request7178
2018-06-08 20:32:14ned.deilysetnosy: + asvetlov, ned.deily
messages: + msg319105
2017-06-29 17:40:25wgcreate