You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ag...@apache.org on 2020/06/01 16:44:29 UTC
[storm] branch master updated: STORM-3640 kill timed out health
check processes
This is an automated email from the ASF dual-hosted git repository.
agresch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/storm.git
The following commit(s) were added to refs/heads/master by this push:
new e89a059 STORM-3640 kill timed out health check processes
new 8362fbc Merge pull request #3275 from agresch/agresch_storm_3640
e89a059 is described below
commit e89a0596ece96edb9371eeaf8a948f5c60f30d69
Author: Aaron Gresch <ag...@yahoo-inc.com>
AuthorDate: Thu May 28 16:26:30 2020 -0500
STORM-3640 kill timed out health check processes
---
.../src/main/java/org/apache/storm/healthcheck/HealthChecker.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/storm-server/src/main/java/org/apache/storm/healthcheck/HealthChecker.java b/storm-server/src/main/java/org/apache/storm/healthcheck/HealthChecker.java
index e68e07c..ab26881 100644
--- a/storm-server/src/main/java/org/apache/storm/healthcheck/HealthChecker.java
+++ b/storm-server/src/main/java/org/apache/storm/healthcheck/HealthChecker.java
@@ -98,8 +98,9 @@ public class HealthChecker {
public static String processScript(Map<String, Object> conf, String script) {
Thread interruptThread = null;
+ Process process = null;
try {
- Process process = Runtime.getRuntime().exec(script);
+ process = Runtime.getRuntime().exec(script);
final long timeout = ObjectReader.getLong(conf.get(DaemonConfig.STORM_HEALTH_CHECK_TIMEOUT_MS), 5000L);
final Thread curThread = Thread.currentThread();
// kill process when timeout
@@ -136,6 +137,9 @@ public class HealthChecker {
return SUCCESS;
} catch (InterruptedException | ClosedByInterruptException e) {
LOG.warn("Script: {} timed out.", script);
+ if (process != null) {
+ process.destroyForcibly();
+ }
return TIMEOUT;
} catch (Exception e) {
LOG.warn("Script failed with exception: ", e);