diff --git a/common/source/java/ch/systemsx/cisd/common/process/ProcessExecutor.java b/common/source/java/ch/systemsx/cisd/common/process/ProcessExecutor.java index 1881aefc2157e5aec8b079e075b24b835a6c840c..a1fd2e0036ccc868491dfd9351bf23b6cd20d497 100644 --- a/common/source/java/ch/systemsx/cisd/common/process/ProcessExecutor.java +++ b/common/source/java/ch/systemsx/cisd/common/process/ProcessExecutor.java @@ -127,14 +127,17 @@ class ProcessExecutor } } - /** Corresponds to a short timeout of 1/10 s. */ - private static final long SHORT_TIMEOUT = 100; + /** Corresponds to a short timeout of 1/5 s. */ + private static final long SHORT_TIMEOUT = 200; /** * The fraction of the timeout that should be applied when reading the process output. */ private static final double OUTPUT_READING_TIMEOUT_FRACTION = 0.1; + /** The minimum timeout to wait for the process output to complete. */ + private static final long OUTPUT_READING_TIMEOUT_MIN = 250; + /** Corresponds to a short timeout of 1/100 s. */ private static final long PAUSE_MILLIS = 10; @@ -606,7 +609,8 @@ class ProcessExecutor } this.millisToWaitForIOCompletion = Math.round((millisToWaitForCompletion == ConcurrencyUtilities.NO_TIMEOUT) ? ConcurrencyUtilities.NO_TIMEOUT - : this.millisToWaitForCompletion * OUTPUT_READING_TIMEOUT_FRACTION); + : Math.max(OUTPUT_READING_TIMEOUT_MIN, this.millisToWaitForCompletion + * OUTPUT_READING_TIMEOUT_FRACTION)); this.processIOStrategy = ioStrategy; this.commandLine = Collections.unmodifiableList(commandLine); this.environment = environment;