Issue38884
Created on 2019-11-21 19:11 by Valentyn Tymofieiev, last changed 2022-04-11 14:59 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| import_module_not_found.py | Valentyn Tymofieiev, 2019-11-21 19:11 | |||
| import_deadlock.py | Valentyn Tymofieiev, 2019-11-21 19:13 | |||
| issue38884.zip | Valentyn Tymofieiev, 2019-11-21 22:30 | |||
| Messages (14) | |||
|---|---|---|---|
| msg357198 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 19:11 | |
Attached import_module_not_found.py consistently fails for me on Python 3.7.5 and earlier Python 3 versions that I have tried with File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "import_module_not_found.py", line 8, in t2 return __import__("tensorflow.estimator", level=0) ModuleNotFoundError: No module named 'tensorflow.estimator Threads in this example finish successfully if executed sequentially. I have not tried higher versions of Python, but I cannot reproduce this on Python 2.7. Is this an expected behavior? Thank you. |
|||
| msg357199 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 19:13 | |
Attached import_deadlock.py fails with
...
File "<frozen importlib._bootstrap>", line 980, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('tensorflow_transform.tf_metadata.metadata_io')
under the same conditions.
|
|||
| msg357202 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 19:31 | |
Possibly related: https://bugs.python.org/issue35943 |
|||
| msg357214 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2019-11-21 20:20 | |
Can you test this with a package that isn't tensorflow (e.g. something else in the stdlib or something created manually; basically a smaller reproducer)? It's hard to diagnose if this is really Python or not without a smaller reproducer as tensorflow might be doing some things behind the scenes that would break this due to it being an extension module. |
|||
| msg357227 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 22:30 | |
Attaching a minimal repro with simple project hierarchy. |
|||
| msg357228 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 22:31 | |
Repro: unpack issue38884.zip python input_deadlock.py (fails on Python 3.7, but not on 2.7). |
|||
| msg357230 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 22:33 | |
input_deadlock.py in issue38884.zip has a left-over comment: # Requires pip install tensorflow==2.0.0 tensorflow-transform==0.15.0 Please ignore that. |
|||
| msg357234 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-21 23:01 | |
The behavior changes between Python 3.2 (no deadlock) and Python 3.3 (deadlock). Deadlock also reproducible on Python 3.8. |
|||
| msg357464 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2019-11-25 22:49 | |
@brett.cannon, looks like I inadvertently dropped you from nosy list, so in case you missed the updates - please take a look at issue38884.zip. Thank you. |
|||
| msg360068 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2020-01-15 17:28 | |
Just checking - is issue38884.zip an acceptable repro for this issue? Thanks. |
|||
| msg360069 - (view) | Author: Brett Cannon (brett.cannon) * ![]() |
Date: 2020-01-15 18:44 | |
@valentyn just assume it's good enough unless some asks otherwise. People are probably too busy right now to be looking at this and so you might be waiting a while for a more definitive answer. |
|||
| msg362746 - (view) | Author: Ryan Petrello (ryan.petrello) | Date: 2020-02-26 22:09 | |
I believe I'm also encountering some version of this bug while importing code from the kombu library within a multi-threaded context. For what it's worth, I'm able to reproduce the reported deadlock (https://bugs.python.org/file48737/issue38884.zip) using python3.8 on RHEL8 and CentOS 8 builds. More details about what I'm encountering here: https://github.com/ansible/awx/issues/5617 https://github.com/ansible/awx/issues/5617#issuecomment-591618205 My intended workaround for now is to just not use a thread (we'll see if it helps): https://github.com/ansible/awx/pull/6093 |
|||
| msg375958 - (view) | Author: Kyle Mulka (repalviglator) | Date: 2020-08-26 20:27 | |
Was able to reproduce with Python 3.9.0rc1 using issue38884.zip. macOS 10.15.5 |
|||
| msg408052 - (view) | Author: Valentyn Tymofieiev (Valentyn Tymofieiev) | Date: 2021-12-08 22:53 | |
Given that the behavior changes between Python 3.2 (no deadlock) and Python 3.3 (deadlock), this should be easily bisectable if someone has the right setup to build and run Python versions from sources in that range. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:23 | admin | set | github: 83065 |
| 2021-12-08 22:53:27 | Valentyn Tymofieiev | set | messages: + msg408052 |
| 2021-12-08 22:31:14 | gregory.p.smith | set | nosy:
+ gregory.p.smith |
| 2020-08-26 20:27:52 | repalviglator | set | messages: + msg375958 |
| 2020-08-26 20:22:18 | repalviglator | set | nosy:
+ repalviglator versions: + Python 3.9 |
| 2020-04-17 14:48:34 | Martin Laus | set | nosy:
+ Martin Laus |
| 2020-03-31 11:12:19 | gjb1002 | set | nosy:
+ gjb1002 |
| 2020-02-26 22:09:39 | ryan.petrello | set | nosy:
+ ryan.petrello messages: + msg362746 |
| 2020-01-15 18:44:24 | brett.cannon | set | messages: + msg360069 |
| 2020-01-15 17:28:51 | Valentyn Tymofieiev | set | messages: + msg360068 |
| 2019-11-25 22:49:12 | Valentyn Tymofieiev | set | messages: + msg357464 |
| 2019-11-25 22:43:41 | Valentyn Tymofieiev | set | nosy:
+ brett.cannon, ncoghlan, eric.snow |
| 2019-11-25 22:42:20 | Valentyn Tymofieiev | set | nosy: + Valentyn Tymofieiev, - brett.cannon |
| 2019-11-25 22:42:00 | Valentyn Tymofieiev | set | nosy: + brett.cannon, - Valentyn Tymofieiev |
| 2019-11-22 03:08:51 | Valentyn Tymofieiev | set | versions: + Python 3.8 |
| 2019-11-21 23:01:41 | Valentyn Tymofieiev | set | messages: + msg357234 |
| 2019-11-21 22:33:02 | Valentyn Tymofieiev | set | messages: + msg357230 |
| 2019-11-21 22:31:34 | Valentyn Tymofieiev | set | messages: + msg357228 |
| 2019-11-21 22:30:19 | Valentyn Tymofieiev | set | files:
+ issue38884.zip nosy: - brett.cannon, ncoghlan, eric.snow messages: + msg357227 |
| 2019-11-21 20:20:18 | brett.cannon | set | messages: + msg357214 |
| 2019-11-21 20:11:53 | brett.cannon | set | nosy:
+ brett.cannon, ncoghlan, eric.snow |
| 2019-11-21 19:31:56 | Valentyn Tymofieiev | set | messages: + msg357202 |
| 2019-11-21 19:13:24 | Valentyn Tymofieiev | set | files:
+ import_deadlock.py messages: + msg357199 |
| 2019-11-21 19:11:54 | Valentyn Tymofieiev | create | |
