orange475 commented on code in PR #1717:
URL: https://github.com/apache/samza/pull/1717#discussion_r2201988221
##########
samza-core/src/main/java/org/apache/samza/container/host/PosixCommandBasedStatisticsGetter.java:
##########
@@ -55,6 +55,15 @@ private List<String> getAllCommandOutput(String[] cmdArray)
throws IOException {
}
}
processReader.close();
+
+ // Wait for the process to complete to prevent resource leak
+ try {
+ executable.waitFor();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new IOException("Interrupted while waiting for command to
complete", e);
+ }
Review Comment:
Done, PTAL
##########
samza-core/src/main/java/org/apache/samza/container/host/PosixCommandBasedStatisticsGetter.java:
##########
@@ -55,6 +55,15 @@ private List<String> getAllCommandOutput(String[] cmdArray)
throws IOException {
}
}
processReader.close();
Review Comment:
Added the stderr buffer draining.
##########
samza-core/src/main/java/org/apache/samza/container/host/PosixCommandBasedStatisticsGetter.java:
##########
@@ -55,6 +55,15 @@ private List<String> getAllCommandOutput(String[] cmdArray)
throws IOException {
}
}
processReader.close();
+
+ // Wait for the process to complete to prevent resource leak
+ try {
+ executable.waitFor();
+ } catch (InterruptedException e) {
Review Comment:
We'll do destroy in finally block
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]