-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit the number of Scheduler#disposeGracefully threads (#3259)
This change introduces a `DisposeAwaiterRunnable` with a small pool of threads dedicated to polling the termination status after a graceful Scheduler shutdown. Previously, one Thread would be created for each Scheduler that is disposed gracefully. While we don't expect this to be an issue in most production applications, this can lead to hitting native thread limits faster. Notably, stress tests around graceful disposal create a lot of schedulers for that purpose. This change also ensures that the evictor executorServices of both the BoundedElasticScheduler and ElasticScheduler are limited to at most 1 thread. Finally, it attempts to improve the SchedulersStressTest to avoid the OOMs as much as possible: block on disposeGracefully() calls, increase the heap of forked JVMs for jcstress, and ultimately stop covering the BoundedElasticScheduler in the stress test. Fixes #3258.
- Loading branch information
1 parent
86f500d
commit 83bc1b8
Showing
8 changed files
with
147 additions
and
152 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
Oops, something went wrong.