fix: restore thread interrupt status after catching InterruptedException - #1018
Open
Zjianru wants to merge 1 commit into
Open
fix: restore thread interrupt status after catching InterruptedException#1018Zjianru wants to merge 1 commit into
Zjianru wants to merge 1 commit into
Conversation
This addresses issue qos-ch#998 where Logback catches InterruptedException without re-interrupting the thread, potentially causing caller threads to lose their interruption status. Changes: - AbstractSocketAppender.append() and .connectSocketAndDispatchEvents() - ConcurrentServerRunner.run() - AsyncAppenderBase.Worker.run() - DefaultShutdownHook.run() - Example classes (ConsolePluginClient, NumberCruncherServer) Also clears any prior interrupt in AsyncAppenderBaseTest to ensure test stability. All existing tests pass. Signed-off-by: codez <codezhujr@gmail.com>
Zjianru
force-pushed
the
fix/interrupt-status-restoration
branch
from
February 11, 2026 11:37
b2352b8 to
1f9e217
Compare
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.
Fixes #998
Logback catches InterruptedException without re-interrupting the thread, which can cause caller threads to lose their interruption status and potentially deadlock.
This PR adds Thread.currentThread().interrupt() in all catch (InterruptedException) blocks found in production code (and example code for consistency).
Changes
Testing
Impact
Low risk: only adds interrupt restoration without altering existing logic.