diff options
author | Harald Musum <musum@yahoo-inc.com> | 2017-06-14 11:07:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-14 11:07:10 +0200 |
commit | fd3a50bea7e48c61ec2577ee4ee5c18e17625935 (patch) | |
tree | 8adc185458e65fb60c6babb078476028e36c1a20 /filedistributionmanager | |
parent | 5b62f9f29a54dcb49bee8ccbfdc5e48da8d00cda (diff) |
Revert "Handle errors when reinitializing file distributor"
Diffstat (limited to 'filedistributionmanager')
-rw-r--r-- | filedistributionmanager/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionManager.java | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/filedistributionmanager/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionManager.java b/filedistributionmanager/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionManager.java index 7965cf34ccf..64cdd9da416 100644 --- a/filedistributionmanager/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionManager.java +++ b/filedistributionmanager/src/main/java/com/yahoo/vespa/filedistribution/FileDistributionManager.java @@ -1,14 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.filedistribution; -import com.yahoo.system.execution.ProcessExecutor; -import com.yahoo.system.execution.ProcessResult; - import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.List; -import java.util.Optional; import java.util.concurrent.locks.Lock; /** @@ -113,19 +109,10 @@ public class FileDistributionManager { } public void reloadDeployFileDistributor() { - String binaryName = "filedistributor"; - String command = "pkill -SIGUSR1 -x " + binaryName; - int timeoutSeconds = 10; try (LockGuard guard = new LockGuard(lock)) { - Optional<ProcessResult> result = new ProcessExecutor.Builder(timeoutSeconds).build().execute(command); - if (! result.isPresent()) { - throw new RuntimeException(String.format("Executing '%s' timed out", command)); - } else if (result.get().exitCode != 0) { - throw new RuntimeException(String.format("Error when executing '%s', exit code %d: %s\n%s", - command, result.get().exitCode, result.get().stdOut, result.get().stdErr)); - } + Runtime.getRuntime().exec("pkill -SIGUSR1 -x filedistributor"); } catch (IOException e) { - throw new RuntimeException("Failed to reinitialize " + binaryName, e); + throw new RuntimeException("Failed to reinitialize the filedistributor", e); } } |