-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually terminate the Py4JServer during engine shutdown #4644
Closed
Conversation
This file contains 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
cfmcgrady
changed the title
Manually terminate the Py4JServer during engine shutdown.
Manually terminate the Py4JServer during engine shutdown
Mar 31, 2023
the start and stop need to be syncronized |
The start function has already been synchronized in the caller's code, shall we need to refine this? Lines 240 to 253 in d9e14f2
|
updated. |
cxzl25
approved these changes
Mar 31, 2023
pan3793
approved these changes
Mar 31, 2023
pan3793
pushed a commit
that referenced
this pull request
Mar 31, 2023
### _Why are the changes needed?_ Due to the Py4JServer initiating with a non-daemon thread, there is a possibility of it impeding the engine's termination. Therefore, it is imperative to manually terminate the Py4JServer during engine shutdown. ``` "Thread-23" #96 prio=5 os_prio=0 cpu=7.93ms elapsed=187532.67s tid=0x00007fee840cf000 nid=0x8f runnable [0x00007fedca6bf000] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(java.base11.0.16/Native Method) at java.net.AbstractPlainSocketImpl.accept(java.base11.0.16/Unknown Source) at java.net.ServerSocket.implAccept(java.base11.0.16/Unknown Source) at java.net.ServerSocket.accept(java.base11.0.16/Unknown Source) at py4j.GatewayServer.run(GatewayServer.java:685) at java.lang.Thread.run(java.base11.0.16/Unknown Source) ``` ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request Closes #4644 from cfmcgrady/pyserver-non-daemon. Closes #4644 d4f1a57 [Fu Chen] synchronized cdc9630 [Fu Chen] shutdown Py4JServer Authored-by: Fu Chen <cfmcgrady@gmail.com> Signed-off-by: Cheng Pan <chengpan@apache.org> (cherry picked from commit 726a831) Signed-off-by: Cheng Pan <chengpan@apache.org>
Thanks, merged to master/1.7 |
5 tasks
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.
Why are the changes needed?
Due to the Py4JServer initiating with a non-daemon thread, there is a possibility of it impeding the engine's termination. Therefore, it is imperative to manually terminate the Py4JServer during engine shutdown.
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request