Skip to content

Commit ae45303

Browse files
fix(unix): return true when process status check fails to prevent premature cleanup
1 parent fc6abcf commit ae45303

File tree

1 file changed

+7
-2
lines changed
  • src/main/java/com/aws/greengrass/util/platforms/unix

1 file changed

+7
-2
lines changed

src/main/java/com/aws/greengrass/util/platforms/unix/UnixExec.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@ public void close() throws IOException {
126126
boolean isAnyProcessAlive = pidProcesses.stream().anyMatch(pidProcess -> {
127127
try {
128128
return pidProcess.isAlive();
129-
} catch (IOException ignored) {
129+
} catch (IOException e) {
130+
logger.atWarn().cause(e).log("Unable to determine if process is alive, "
131+
+ "assuming it is to allow further cleanup attempts");
132+
return true;
130133
} catch (InterruptedException e) {
134+
logger.atWarn().cause(e).log("Unable to determine if process is alive, "
135+
+ "assuming it is to allow further cleanup attempts");
131136
Thread.currentThread().interrupt();
137+
return true;
132138
}
133-
return false;
134139
});
135140
if (isAnyProcessAlive) {
136141
logger.atWarn()

0 commit comments

Comments
 (0)