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 rpurdie
Recipients rpurdie
Date 2022-04-01.20:23:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648844604.18.0.0986113969555.issue47195@roundup.psfhosted.org>
In-reply-to
Content
We've seen tracebacks in production like:

  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load(name='oe.gpg_sign', import_=<built-in function __import__>)
  File "<frozen importlib._bootstrap>", line 158, in _ModuleLockManager.__enter__()
  File "<frozen importlib._bootstrap>", line 110, in _ModuleLock.acquire()
 KeyError: 139622474778432

and

  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load(name='oe.path', import_=<built-in function __import__>)
  File "<frozen importlib._bootstrap>", line 158, in _ModuleLockManager.__enter__()
  File "<frozen importlib._bootstrap>", line 110, in _ModuleLock.acquire()
 KeyError: 140438942700992

I've attached a reproduction script which shows that if an import XXX is in progress and waiting at the wrong point when an interrupt arrives (in this case a signal) and triggers it's own import YYY, _blocking_on[tid] in importlib/_bootstrap.py gets overwritten and lost, triggering the traceback we see above upon exit from the second import.

I'm using a signal handler here as the interrupt, I don't know what our production source is as yet but this reproducer proves it is possible.
History
Date User Action Args
2022-04-01 20:23:24rpurdiesetrecipients: + rpurdie
2022-04-01 20:23:24rpurdiesetmessageid: <1648844604.18.0.0986113969555.issue47195@roundup.psfhosted.org>
2022-04-01 20:23:24rpurdielinkissue47195 messages
2022-04-01 20:23:24rpurdiecreate