Skip to content

Commit bb30ecc

Browse files
committed
Merge pull request #50451 from SebTardif
* fix-processrunner-interrupt-flag: Restore interrupt flag in ProcessRunner on InterruptedException Closes gh-50451
2 parents 3e5ad73 + 8a28cef commit bb30ecc

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ProcessRunner.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ private int waitForProcess(Process process) {
122122
return process.waitFor();
123123
}
124124
catch (InterruptedException ex) {
125-
throw new IllegalStateException("Interrupted waiting for %s".formatted(process));
125+
Thread.currentThread().interrupt();
126+
throw new IllegalStateException("Interrupted waiting for %s".formatted(process), ex);
126127
}
127128
}
128129

@@ -174,6 +175,7 @@ public String toString() {
174175
return this.output.toString();
175176
}
176177
catch (InterruptedException ex) {
178+
Thread.currentThread().interrupt();
177179
return null;
178180
}
179181
}

0 commit comments

Comments
 (0)