Skip to content

ProcessRunner does not restore interrupt flag on InterruptedException #50450

@SebTardif

Description

@SebTardif

In ProcessRunner, two InterruptedException catch blocks do not restore the thread's interrupt flag before re-throwing or returning:

  1. waitForProcess (line 140): catches InterruptedException, throws IllegalStateException without calling Thread.currentThread().interrupt() first, and without chaining the original exception.
  2. ReaderThread.toString (line 192): catches InterruptedException and returns "" without restoring the interrupt flag.

This is inconsistent with every other InterruptedException handler in the codebase (e.g., LogbackLoggingSystem, SpringApplicationShutdownHook, ServiceReadinessChecks, FileWatcher, OnClassCondition) which all restore the flag.

Without restoring the flag, code higher in the call stack (such as Docker Compose lifecycle shutdown handling) cannot detect that the thread was interrupted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions