Fix 846 Formatter leaks threads and memory#847
Closed
stiemannkj1 wants to merge 1 commit intogoogle:mastergoogle/google-java-format:masterfrom
stiemannkj1:fix-846-mem-thread-leakstiemannkj1/google-java-format:fix-846-mem-thread-leakCopy head branch name to clipboard
Closed
Fix 846 Formatter leaks threads and memory#847stiemannkj1 wants to merge 1 commit intogoogle:mastergoogle/google-java-format:masterfrom stiemannkj1:fix-846-mem-thread-leakstiemannkj1/google-java-format:fix-846-mem-thread-leakCopy head branch name to clipboard
stiemannkj1 wants to merge 1 commit intogoogle:mastergoogle/google-java-format:masterfrom
stiemannkj1:fix-846-mem-thread-leakstiemannkj1/google-java-format:fix-846-mem-thread-leakCopy head branch name to clipboard
Conversation
5fcb5e0 to
7e12876
Compare
7e12876 to
db89e6a
Compare
cushon
reviewed
Feb 3, 2023
cushon
requested changes
Feb 3, 2023
core/src/test/java/com/google/googlejavaformat/java/MainTest.java
Outdated
Show resolved
Hide resolved
3671975 to
e61f7d9
Compare
e61f7d9 to
0ca1e9b
Compare
cushon
approved these changes
Feb 3, 2023
Contributor
Author
|
@cushon do I need to do anything to get the |
Collaborator
Nope, thanks! I can take it from here |
cushon
reviewed
Feb 3, 2023
|
|
||
| // #846 Clean up any resources and threads created by the executorService. | ||
| final boolean completedShutdown = | ||
| MoreExecutors.shutdownAndAwaitTermination(executorService, 100, TimeUnit.MILLISECONDS); |
Collaborator
There was a problem hiding this comment.
I'm thinking to use a slightly longer deadline here, maybe 5 seconds.
This is just an FYI--I can make the change, no need to upload another snapshot.
| // before shutdown, so no tasks should be left over by the time we shut down the executor | ||
| // service. | ||
| throw new IllegalStateException( | ||
| "Failed to complete all formatting tasks and shut down the formatter."); |
Collaborator
There was a problem hiding this comment.
I think this should print the message to stderr and return with a non-zero exit code, similar to the error handling on other code paths here.
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.
I've signed the CLA.