Repository navigation
Close JavaLogger file handlers - #3468
Merged
velo merged 1 commit intoJul 28, 2026
Merged
Conversation
Signed-off-by: hutiefang <hutiefang@qq.com>
Collaborator
|
FYI - I have an easier fix for this issue: #3493 The reality is that closing log files while the application is running is not a normal thing, so I think the easy approach to just ignore the file deletion during test is appropriate. |
velo
approved these changes
Jul 28, 2026
velo
left a comment
Member
There was a problem hiding this comment.
Approved via agent-assisted review: change includes tests, no backwards-compatibility break, no security concerns, CI green.
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.
Summary
This addresses the
MultipleLoggerTest/ JULFileHandlerpart of #2752.Logger.JavaLogger.appendToFile(...)addsFileHandlerinstances to the underlying JUL logger, but there was no supported way to close them. On Windows this can keep the temp log files locked until the JVM exits, which prevents JUnit from cleaning up@TempDir.The change makes
JavaLoggerCloseable, tracks only the handlers added by thatJavaLoggerinstance, and closes/removes those handlers fromclose(). TheMultipleLoggerTestcases now close their loggers after checking handler setup.Verification
./mvnw -pl core -Dtest=MultipleLoggerTest#javaLoggerClosesFileHandlers test -DskipITs -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=truefailed before the production change becauseJavaLogger.close()did not exist../mvnw -pl core -Dtest=MultipleLoggerTest test -DskipITs -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=truepassed, 4 tests../mvnw -pl core -Dtest=DefaultContractInheritanceTest,MultipleLoggerTest test -DskipITs -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=truepassed, 13 tests../mvnw -pl core test -DskipITs -Dlicense.skip=truepassed, 635 tests, 0 failures/errors, 3 skipped../mvnw -pl core git-code-format:validate-code-format -Dlicense.skip=true -DskipTestspassed.git diff --checkpassed.I did not change the
DefaultContractInheritanceTestpath in this PR; that looks like a separate reflection-order/generic bridge-method issue and is better handled independently.