GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-100228: Document the os.fork threads DeprecationWarning. by gpshead · Pull Request #109767 · python/cpython

Conversation

@gpshead

@gpshead gpshead commented Sep 23, 2023 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Better document the os.fork warning to explain questions such as those raised in https://discuss.python.org/t/concerns-regarding-deprecation-of-fork-with-alive-threads/33555.


📚 Documentation preview 📚: https://cpython-previews--109767.org.readthedocs.build/

  • Issue: raise a Warning when os.fork() is called and the process has multiple threads #100228

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gpshead
Document the os.fork threads DeprecationWarning.
c2c36c0
@gpshead gpshead added docs Documentation in the Doc dir skip news needs backport to 3.12 only security fixes labels Sep 23, 2023
@gpshead gpshead changed the title Document the os.fork threads DeprecationWarning. gh-100228: Document the os.fork threads DeprecationWarning. Sep 23, 2023
@gpshead
gpshead marked this pull request as ready for review September 23, 2023 00:20
@bedevere-app bedevere-app Bot mentioned this pull request Sep 12, 2023
raise a Warning when os.fork() is called and the process has multiple threads #100228
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Sep 23, 2023
@gpshead
gpshead requested a review from hugovk September 23, 2023 00:20
AA-Turner
AA-Turner reviewed Sep 23, 2023
View reviewed changes
Comment thread Doc/whatsnew/3.12.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

AA-Turner
AA-Turner reviewed Sep 23, 2023
View reviewed changes
Comment thread Doc/library/concurrent.futures.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/concurrent.futures.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/multiprocessing.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/os.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/os.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

gpshead and others added 6 commits September 22, 2023 21:09
@gpshead @AA-Turner
Update Doc/library/concurrent.futures.rst
d38b056
Co-authored-by: Adam Turner <[email protected]>
@gpshead @AA-Turner
Update Doc/library/concurrent.futures.rst
d594072
Co-authored-by: Adam Turner <[email protected]>
@gpshead @AA-Turner
Update Doc/library/multiprocessing.rst
c8f7a73
Co-authored-by: Adam Turner <[email protected]>
@gpshead @AA-Turner
Update Doc/library/os.rst
227c883
Co-authored-by: Adam Turner <[email protected]>
@gpshead @AA-Turner
Update Doc/library/os.rst
49fa636
Co-authored-by: Adam Turner <[email protected]>
@gpshead
Move to the proper Deprecated section.
126ed5e
(thanks AA-Turner!)
hugovk
hugovk approved these changes Sep 23, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple of suggestions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead reacted with hooray emoji
All reactions
  • 🎉 1 reaction
Comment thread Doc/library/concurrent.futures.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/os.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Sep 23, 2023
gpshead and others added 2 commits September 22, 2023 21:53
@gpshead @hugovk
Update Doc/library/concurrent.futures.rst
f47b99c
Co-authored-by: Hugo van Kemenade <[email protected]>
@gpshead @hugovk
Update Doc/library/os.rst
5960e72
Co-authored-by: Hugo van Kemenade <[email protected]>
AA-Turner
AA-Turner approved these changes Sep 23, 2023
View reviewed changes

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

A

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@gpshead
gpshead enabled auto-merge (squash) September 23, 2023 05:03
@gpshead
gpshead merged commit 5e7ea95 into python:main Sep 23, 2023
@miss-islington

miss-islington commented Sep 23, 2023

Copy link
Copy Markdown
Contributor

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Sep 23, 2023
@gpshead
gpshead deleted the docs/fork_threads_warning branch September 23, 2023 05:04
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2023
@gpshead @AA-Turner
@hugovk @miss-islington
pythongh-100228: Document the os.fork threads DeprecationWarning. (py…
951212b
…thonGH-109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳

(cherry picked from commit 5e7ea95)

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-app

bedevere-app Bot commented Sep 23, 2023

Copy link
Copy Markdown

GH-109773 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Sep 23, 2023
malemburg
malemburg reviewed Sep 23, 2023
View reviewed changes

@malemburg malemburg left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these clarifications and warnings.

Apart from the change in the "What's new" I think this is good to go.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/whatsnew/3.12.rst
We added the warning to to raise awareness as issues encounted by code doing
this are becoming more frequent. See the :func:`os.fork` documentation for
more details.

@malemburg malemburg Sep 23, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would copy the paragraph from the os.fork() docs here as well, to make it easier for people to find the reasoning behind this:

See `this discussion on fork being incompatible with threads
<https://discuss.python.org/t/33555>`_
for technical details of why we're surfacing this longstanding
platform compatibility problem to developers.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@gpshead gpshead Sep 23, 2023

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I included that (edited) over in the 3.12 backport #109773. I'll make the same edit in main after that is merged.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gpshead added a commit to miss-islington/cpython that referenced this pull request Sep 23, 2023
@gpshead
link to the discussion thread from whatsnew
e38d710
Include the link to the discussion in the what's new text per @malemberg's comment on. python#109767

(i'll follow up with a PR to main to include this edit there as well)
Yhg1s pushed a commit that referenced this pull request Sep 24, 2023
@miss-islington @gpshead
@AA-Turner @hugovk
[3.12] gh-100228: Document the os.fork threads DeprecationWarning. (G…
62df559
…H-109767) (#109773)

* gh-100228: Document the os.fork threads DeprecationWarning. (GH-109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳

(cherry picked from commit 5e7ea95)

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>

* link to the discussion thread from whatsnew

Include the link to the discussion in the what's new text per @malemberg's comment on. #109767

(i'll follow up with a PR to main to include this edit there as well)

---------

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@gpshead gpshead mentioned this pull request Sep 24, 2023
Sync whatsnew with the edit I made in the 3.12 backport PR. #109807
Merged
gpshead added a commit that referenced this pull request Sep 24, 2023
@gpshead
Sync whatsnew with the edit I made in the 3.12 backport PR. (#109807)
e81bd3f
A post main merge edit to the text was added in the 3.12 backport PR.
  e38d710

This includes that in main.  It's a minor edit over #109767 to resolve the comment there.
github-actions Bot pushed a commit to m-aciek/python-docs-weblate that referenced this pull request Sep 24, 2023
[3.12] gh-100228: Document the os.fork threads DeprecationWarning. (G…
3c902a3
…H-109767) (#109773)

* gh-100228: Document the os.fork threads DeprecationWarning. (GH-109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳

(cherry picked from commit 5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e)

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>

* link to the discussion thread from whatsnew

Include the link to the discussion in the what's new text per @malemberg's comment on. python/cpython#109767

(i'll follow up with a PR to main to include this edit there as well)

---------

Co-authored-by: Gregory P. Smith <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>

CPython-sync-commit: 62df559448362f9a4291661d64aee30474dec025
csm10495 pushed a commit to csm10495/cpython that referenced this pull request Sep 28, 2023
@gpshead @AA-Turner
@hugovk @csm10495
pythongh-100228: Document the os.fork threads DeprecationWarning. (py…
f1cffd7
…thon#109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳 

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
csm10495 pushed a commit to csm10495/cpython that referenced this pull request Sep 28, 2023
@gpshead @csm10495
Sync whatsnew with the edit I made in the 3.12 backport PR. (python#1…
2c0fa66
…09807)

A post main merge edit to the text was added in the 3.12 backport PR.
  python@e38d710

This includes that in main.  It's a minor edit over python#109767 to resolve the comment there.
This was referenced Aug 29, 2024
Deprecation warning for os.fork on Python 3.12 gevent/gevent#2052
Closed
Deprecation warning for os.fork on Python 3.12 benoitc/gunicorn#3289
Closed
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@gpshead @AA-Turner
@hugovk @Glyphack
pythongh-100228: Document the os.fork threads DeprecationWarning. (py…
d11105b
…thon#109767)

Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.

Many reviews and doc cleanup edits by Adam & Hugo. 🥳 

Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@gpshead @Glyphack
Sync whatsnew with the edit I made in the 3.12 backport PR. (python#1…
10229f2
…09807)

A post main merge edit to the text was added in the 3.12 backport PR.
  python@e38d710

This includes that in main.  It's a minor edit over python#109767 to resolve the comment there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@malemburg malemburg malemburg left review comments
@hugovk hugovk hugovk approved these changes
@AA-Turner AA-Turner AA-Turner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@gpshead @miss-islington @hugovk @malemburg @AA-Turner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.