-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CELEBORN-805] Immediate shutdown of server upon completion of unit t…
…est to prevent potential resource leakage ### What changes were proposed in this pull request? As title ### Why are the changes needed? Recently, while conducting the sbt build test, it came to my attention that certain resources such as ports and threads were not being released promptly. This pull request introduces a new method, `shutdown(graceful: Boolean)`, to the `Service` trait. When invoked by `MiniClusterFeature.shutdownMiniCluster`, it calls `worker.shutdown(graceful = false)`. This implementation aims to prevent possible memory leaks during CI processes. Before this PR the unit tests in the `client/common/master/service/worker` modules resulted in leaked ports. ``` $ jps 1138131 Jps 1130743 sbt-launch-1.9.0.jar $ netstat -lntp | grep 1130743 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 127.0.0.1:12345 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:41563 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:42905 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:44419 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:45025 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:44799 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:39053 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:39029 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:39475 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:40153 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:33051 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:33449 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:34073 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:35347 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:35971 0.0.0.0:* LISTEN 1130743/java tcp 0 0 0.0.0.0:36799 0.0.0.0:* LISTEN 1130743/java tcp 0 0 192.168.1.151:40775 0.0.0.0:* LISTEN 1130743/java tcp 0 0 192.168.1.151:44457 0.0.0.0:* LISTEN 1130743/java ``` After this PR: ``` $ jps 1114423 Jps 1107544 sbt-launch-1.9.0.jar $ netstat -lntp | grep 1107544 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass GA Closes #1727 from cfmcgrady/shutdown. Authored-by: Fu Chen <[email protected]> Signed-off-by: Cheng Pan <[email protected]> (cherry picked from commit 7c6644b) Signed-off-by: Cheng Pan <[email protected]>
- Loading branch information
Showing
8 changed files
with
174 additions
and
98 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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