Skip to content

Docker Compose support does not restore thread interrupt flag when catching InterruptedException#50451

Merged
snicoll merged 1 commit into
spring-projects:3.5.xfrom
SebTardif:fix-processrunner-interrupt-flag
May 29, 2026
Merged

Docker Compose support does not restore thread interrupt flag when catching InterruptedException#50451
snicoll merged 1 commit into
spring-projects:3.5.xfrom
SebTardif:fix-processrunner-interrupt-flag

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

ProcessRunner.waitForProcess and ReaderThread.toString catch
InterruptedException without restoring the thread interrupt flag.
This prevents callers higher up the stack from detecting the
interruption. Every other InterruptedException handler in the
codebase restores the flag; these two were the only omissions.

Add Thread.currentThread().interrupt() before re-throwing or
returning in both catch blocks. Also chain the original exception
as the cause in waitForProcess for debuggability.

Closes #50450

Signed-off-by: Sebastien Tardif sebtardif@ncf.ca

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 15, 2026
@wilkinsona wilkinsona changed the title Restore interrupt flag in ProcessRunner on InterruptedException Docker Compose support does not restore thread interrupt flag when catching InterruptedException May 16, 2026
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels May 16, 2026
@wilkinsona wilkinsona added this to the 3.5.x milestone May 16, 2026
ProcessRunner.waitForProcess and ReaderThread.toString catch
InterruptedException without restoring the thread interrupt flag.
This prevents callers higher up the stack from detecting the
interruption. Every other InterruptedException handler in the
codebase restores the flag; these two were the only omissions.

Add Thread.currentThread().interrupt() before re-throwing or
returning in both catch blocks. Also chain the original exception
as the cause in waitForProcess for debuggability.

See spring-projectsgh-50451

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@snicoll snicoll self-assigned this May 29, 2026
@snicoll snicoll changed the base branch from main to 3.5.x May 29, 2026 10:29
@snicoll snicoll force-pushed the fix-processrunner-interrupt-flag branch from ea295d1 to 8a28cef Compare May 29, 2026 10:29
@snicoll snicoll modified the milestones: 3.5.x, 3.5.15 May 29, 2026
@snicoll snicoll merged commit bb30ecc into spring-projects:3.5.x May 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProcessRunner does not restore interrupt flag on InterruptedException

4 participants