Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-1596321: Fix threading._shutdown() for the main thread#28549

Merged
vstinner merged 1 commit into
python:mainpython/cpython:mainfrom
vstinner:threadCopy head branch name to clipboard
Sep 27, 2021
Merged

bpo-1596321: Fix threading._shutdown() for the main thread#28549
vstinner merged 1 commit into
python:mainpython/cpython:mainfrom
vstinner:threadCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Sep 24, 2021

Copy link
Copy Markdown
Member

Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.

https://bugs.python.org/issue1596321

Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
Comment thread Lib/threading.py
@gpshead gpshead added needs backport to 3.9 needs backport to 3.10 only security fixes type-bug An unexpected behavior, bug, or error labels Sep 25, 2021
@vstinner vstinner merged commit 95d3137 into python:main Sep 27, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@vstinner vstinner deleted the thread branch September 27, 2021 21:09
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 27, 2021
…28549)

Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
(cherry picked from commit 95d3137)

Co-authored-by: Victor Stinner <vstinner@python.org>
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @vstinner, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 95d31370829b7d729667588e0a9943217401ea5b 3.9

@bedevere-bot

Copy link
Copy Markdown

GH-28588 is a backport of this pull request to the 3.10 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-28589 is a backport of this pull request to the 3.9 branch.

@vstinner

Copy link
Copy Markdown
Member Author

@gpshead: Thanks for the review. Yeah, moving atexit causes a minor behavior change. I don't think that anyone relies on it.

miss-islington added a commit that referenced this pull request Sep 27, 2021
Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.
(cherry picked from commit 95d3137)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Sep 27, 2021
…GH-28589)

Fix the threading._shutdown() function when the threading module was
imported first from a thread different than the main thread: no
longer log an error at Python exit.

(cherry picked from commit 95d3137)
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable 3.9 has failed when building commit 94d19f6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/176/builds/234) and take a look at the build logs.
  4. Check if the failure is related to this commit (94d19f6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/176/builds/234

Failed tests:

  • test_multiprocessing_spawn
  • test_multiprocessing_forkserver
  • test_multiprocessing_fork

Failed subtests:

  • test_shared_memory_basics - test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_spawn.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_fork.WithProcessesTestSharedMemory

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_concurrent_futures: 3 min 4 sec
  • test_gdb: 2 min 47 sec
  • test_multiprocessing_spawn: 2 min 4 sec
  • test_capi: 1 min 58 sec
  • test_peg_generator: 1 min 40 sec
  • test_multiprocessing_forkserver: 1 min 36 sec
  • test_asyncio: 1 min 17 sec
  • test_unparse: 1 min 13 sec
  • test_multiprocessing_fork: 1 min 10 sec
  • test_tokenize: 1 min 8 sec

3 tests failed:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

12 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_startfile
test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg
test_winsound test_zipfile64

3 re-run tests:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

Total duration: 5 min 19 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64/build/Lib/test/_test_multiprocessing.py", line 3774, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_5423fe8e'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_0694f074'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_c2b3bb8e'

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable Clang 3.9 has failed when building commit 94d19f6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/365/builds/236) and take a look at the build logs.
  4. Check if the failure is related to this commit (94d19f6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/365/builds/236

Failed tests:

  • test_multiprocessing_spawn
  • test_multiprocessing_forkserver
  • test_multiprocessing_fork

Failed subtests:

  • test_shared_memory_basics - test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_spawn.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_fork.WithProcessesTestSharedMemory

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 36 sec
  • test_peg_generator: 2 min 14 sec
  • test_multiprocessing_spawn: 1 min 37 sec
  • test_multiprocessing_forkserver: 1 min 16 sec
  • test_multiprocessing_fork: 1 min 2 sec
  • test_asyncio: 55.6 sec
  • test_signal: 47.2 sec
  • test_io: 38.3 sec
  • test_socket: 38.3 sec
  • test_tokenize: 32.2 sec

3 tests failed:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

12 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_startfile
test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg
test_winsound test_zipfile64

3 re-run tests:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

Total duration: 3 min 53 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_d6703e79'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_97470b4e'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_d4d7cb75'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang/build/Lib/test/_test_multiprocessing.py", line 3774, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable Clang Installed 3.9 has failed when building commit 94d19f6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/17/builds/235) and take a look at the build logs.
  4. Check if the failure is related to this commit (94d19f6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/17/builds/235

Failed tests:

  • test_multiprocessing_spawn
  • test_multiprocessing_forkserver
  • test_multiprocessing_fork

Failed subtests:

  • test_shared_memory_basics - test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_spawn.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_fork.WithProcessesTestSharedMemory

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

406 tests OK.

3 tests failed:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

16 tests skipped:
test_asdl_parser test_check_c_globals test_clinic test_devpoll
test_gdb test_ioctl test_kqueue test_msilib test_startfile
test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg
test_winsound test_zipfile64

3 re-run tests:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

Total duration: 4 min 9 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/test/_test_multiprocessing.py", line 3774, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_509d4859'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_e2f9efdb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.clang-installed/build/target/lib/python3.9/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_829a7780'

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO + PGO 3.9 has failed when building commit 94d19f6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/135/builds/234) and take a look at the build logs.
  4. Check if the failure is related to this commit (94d19f6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/135/builds/234

Failed tests:

  • test_multiprocessing_spawn
  • test_multiprocessing_forkserver
  • test_multiprocessing_fork

Failed subtests:

  • test_shared_memory_basics - test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_spawn.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_fork.WithProcessesTestSharedMemory

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

409 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 38 sec
  • test_multiprocessing_spawn: 1 min 29 sec
  • test_multiprocessing_forkserver: 1 min 11 sec
  • test_multiprocessing_fork: 1 min 3 sec
  • test_asyncio: 51.7 sec
  • test_signal: 46.7 sec
  • test_socket: 37.9 sec
  • test_io: 37.1 sec
  • test_pydoc: 31.3 sec
  • test_subprocess: 30.1 sec

3 tests failed:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

13 tests skipped:
test_devpoll test_gdb test_ioctl test_kqueue test_msilib
test_startfile test_tix test_tk test_ttk_guionly test_winconsoleio
test_winreg test_winsound test_zipfile64

3 re-run tests:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

Total duration: 2 min 50 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_9d15129e'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/test/_test_multiprocessing.py", line 3774, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_1b45e0bb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto-pgo/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_0e694706'

@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Fedora Stable LTO 3.9 has failed when building commit 94d19f6.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/426/builds/219) and take a look at the build logs.
  4. Check if the failure is related to this commit (94d19f6) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/426/builds/219

Failed tests:

  • test_multiprocessing_spawn
  • test_multiprocessing_forkserver
  • test_multiprocessing_fork

Failed subtests:

  • test_shared_memory_basics - test.test_multiprocessing_forkserver.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_spawn.WithProcessesTestSharedMemory
  • test_shared_memory_basics - test.test_multiprocessing_fork.WithProcessesTestSharedMemory

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

410 tests OK.

10 slowest tests:

  • test_peg_generator: 2 min 55 sec
  • test_concurrent_futures: 2 min 48 sec
  • test_gdb: 1 min 40 sec
  • test_multiprocessing_spawn: 1 min 40 sec
  • test_multiprocessing_forkserver: 1 min 19 sec
  • test_multiprocessing_fork: 1 min 3 sec
  • test_asyncio: 55.2 sec
  • test_signal: 47.1 sec
  • test_socket: 38.5 sec
  • test_io: 35.6 sec

3 tests failed:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

12 tests skipped:
test_devpoll test_ioctl test_kqueue test_msilib test_startfile
test_tix test_tk test_ttk_guionly test_winconsoleio test_winreg
test_winsound test_zipfile64

3 re-run tests:
test_multiprocessing_fork test_multiprocessing_forkserver
test_multiprocessing_spawn

Total duration: 4 min 48 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_d97c27a3'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto/build/Lib/test/_test_multiprocessing.py", line 3774, in test_shared_memory_basics
    sms = shared_memory.SharedMemory('test01_tsmb', create=True, size=512)
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto/build/Lib/multiprocessing/shared_memory.py", line 103, in __init__
    self._fd = _posixshmem.shm_open(
FileExistsError: [Errno 17] File exists: '/test01_tsmb'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_ccd22972'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.9.cstratak-fedora-stable-x86_64.lto/build/Lib/multiprocessing/resource_tracker.py", line 201, in main
    cache[rtype].remove(name)
KeyError: '/psm_0c07b35b'

hrnciar added a commit to fedora-python/cpython that referenced this pull request Nov 19, 2021
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 14, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 15, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 17, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 17, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 17, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 17, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Aug 22, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Sep 7, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Sep 7, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Sep 13, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 12, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 12, 2022
hroncok pushed a commit to fedora-python/cpython that referenced this pull request Oct 24, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Oct 25, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Nov 15, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Nov 15, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Dec 7, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Dec 7, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Dec 7, 2022
hrnciar added a commit to fedora-python/cpython that referenced this pull request Dec 7, 2022
hroncok pushed a commit to hroncok/cpython that referenced this pull request Jan 3, 2023
hroncok pushed a commit to hroncok/cpython that referenced this pull request Jan 3, 2023
hroncok pushed a commit to hroncok/cpython that referenced this pull request Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.