[issue38884] __import__ is not thread-safe on Python 3

2021-12-08 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2021-12-08 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-08-26 Thread Kyle Mulka


Kyle Mulka  added the comment:

Was able to reproduce with Python 3.9.0rc1 using issue38884.zip. macOS 10.15.5

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-08-26 Thread Kyle Mulka


Change by Kyle Mulka :


--
nosy: +repalviglator
versions: +Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-04-17 Thread Martin Laus


Change by Martin Laus :


--
nosy: +Martin Laus

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-03-31 Thread Geoffrey Bache


Change by Geoffrey Bache :


--
nosy: +gjb1002

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-02-26 Thread Ryan Petrello


Ryan Petrello  added the comment:

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

--
nosy: +ryan.petrello

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-01-15 Thread Brett Cannon


Brett Cannon  added the comment:

@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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2020-01-15 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Just checking - is issue38884.zip an acceptable repro for this issue?
Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-25 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

@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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-25 Thread Valentyn Tymofieiev


Change by Valentyn Tymofieiev :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-25 Thread Valentyn Tymofieiev


Change by Valentyn Tymofieiev :


--
nosy: +Valentyn Tymofieiev -brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-25 Thread Valentyn Tymofieiev


Change by Valentyn Tymofieiev :


--
nosy: +brett.cannon -Valentyn Tymofieiev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Change by Valentyn Tymofieiev :


--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

The behavior changes between Python 3.2 (no deadlock) and Python 3.3 
(deadlock). Deadlock also reproducible on Python 3.8.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Repro: unpack issue38884.zip
python input_deadlock.py

(fails on Python 3.7, but not on 2.7).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Attaching a minimal repro with simple project hierarchy.

--
nosy:  -brett.cannon, eric.snow, ncoghlan
Added file: https://bugs.python.org/file48737/issue38884.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Brett Cannon


Brett Cannon  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Possibly related: https://bugs.python.org/issue35943

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


Valentyn Tymofieiev  added the comment:

Attached import_deadlock.py fails with   

...
File "", line 980, in _find_and_load
  File "", line 149, in __enter__
  File "", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by 
_ModuleLock('tensorflow_transform.tf_metadata.metadata_io')

under the same conditions.

--
Added file: https://bugs.python.org/file48735/import_deadlock.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38884] __import__ is not thread-safe on Python 3

2019-11-21 Thread Valentyn Tymofieiev


New submission from Valentyn Tymofieiev :

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.

--
files: import_module_not_found.py
messages: 357198
nosy: Valentyn Tymofieiev
priority: normal
severity: normal
status: open
title: __import__ is not thread-safe on Python 3
versions: Python 3.7
Added file: https://bugs.python.org/file48734/import_module_not_found.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com