[Fork] Use os.register_at_fork instead of pthread_atfork#32933
Closed
XuanWang-Amos wants to merge 30 commits intogrpc:masterfrom
Closed
[Fork] Use os.register_at_fork instead of pthread_atfork#32933XuanWang-Amos wants to merge 30 commits intogrpc:masterfrom
XuanWang-Amos wants to merge 30 commits intogrpc:masterfrom
Conversation
XuanWang-Amos
added a commit
that referenced
this pull request
Apr 25, 2023
) Fix: #18075 From comments in #18075, `CPython` reinitialize the `GIL` after `pthread_atfork` child handler, thus we shouldn't use any `GIL` related functions in child handler which is what we're currently doing, this PR uses `os.register_at_fork` to replace `pthread_atfork` to prevent any undesired bevahior. This also seems to fixes a thread hanging issue cased by changes in core: #32869 ### Testing: * Passed existing fork tests. (Note that due to some issues in `Bazel`, this change was not verified by `Bazel runs_per_test`). * Tested by patch the core PR, was able to fix Python fork tests: #32933
XuanWang-Amos
added a commit
to XuanWang-Amos/grpc
that referenced
this pull request
May 1, 2023
…c#32935) Fix: grpc#18075 From comments in grpc#18075, `CPython` reinitialize the `GIL` after `pthread_atfork` child handler, thus we shouldn't use any `GIL` related functions in child handler which is what we're currently doing, this PR uses `os.register_at_fork` to replace `pthread_atfork` to prevent any undesired bevahior. This also seems to fixes a thread hanging issue cased by changes in core: grpc#32869 ### Testing: * Passed existing fork tests. (Note that due to some issues in `Bazel`, this change was not verified by `Bazel runs_per_test`). * Tested by patch the core PR, was able to fix Python fork tests: grpc#32933
paulosjca
pushed a commit
to paulosjca/grpc
that referenced
this pull request
May 4, 2023
…c#32935) Fix: grpc#18075 From comments in grpc#18075, `CPython` reinitialize the `GIL` after `pthread_atfork` child handler, thus we shouldn't use any `GIL` related functions in child handler which is what we're currently doing, this PR uses `os.register_at_fork` to replace `pthread_atfork` to prevent any undesired bevahior. This also seems to fixes a thread hanging issue cased by changes in core: grpc#32869 ### Testing: * Passed existing fork tests. (Note that due to some issues in `Bazel`, this change was not verified by `Bazel runs_per_test`). * Tested by patch the core PR, was able to fix Python fork tests: grpc#32933
wanlin31
pushed a commit
that referenced
this pull request
May 18, 2023
) Fix: #18075 From comments in #18075, `CPython` reinitialize the `GIL` after `pthread_atfork` child handler, thus we shouldn't use any `GIL` related functions in child handler which is what we're currently doing, this PR uses `os.register_at_fork` to replace `pthread_atfork` to prevent any undesired bevahior. This also seems to fixes a thread hanging issue cased by changes in core: #32869 ### Testing: * Passed existing fork tests. (Note that due to some issues in `Bazel`, this change was not verified by `Bazel runs_per_test`). * Tested by patch the core PR, was able to fix Python fork tests: #32933
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.