commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Carissimo" <>
Subject [EXEC] Issue with Apache Commons Exec
Date Tue, 06 Jun 2017 14:27:21 GMT

I'm new to using Apache Commons Exec Version 1.3 and I've got a strange one
that I can't seem to figure out.  I'm getting the following stack trace
when I run :

org.apache.commons.exec.ExecuteException: The stop timeout of 300000 ms was
exceeded (Exit value: -559038737)
org.apache.commons.exec.ExecuteException: The stop timeout of 300000 ms was
exceeded (Exit value: -559038737)
	at org.apache.commons.exec.PumpStreamHandler.stopThread
	at org.apache.commons.exec.PumpStreamHandler.stop
	at org.apache.commons.exec.DefaultExecutor.executeInternal
	at org.apache.commons.exec.DefaultExecutor.execute

When I look at the source for DefaultExecutor and PumpStreamHandler, it
appears to me that the external command that I've tried to run has
completed, and the commons exec code is trying to shutdown the threads that
capture stdout and stderr.  According to the timestamps, the exception is
created about 10 minutes after the external command has completed, but I've
set a timeout of 5 minutes ...

Here's what my source looks like :

    CommandLine cmdLine = CommandLine.parse("/bin/bash " + cmd);

    stdout = new ByteArrayOutputStream();
    stderr = new ByteArrayOutputStream();
    PumpStreamHandler psh = new PumpStreamHandler(stdout, stderr);


    ExecuteWatchdog watchdog = new ExecuteWatchdog
(TIMEOUT_TEN_MINUTES);   // timeout in milliseconds

    Executor executor = new DefaultExecutor();

    exitValue = executor.execute(cmdLine, env);

    private long    TIMEOUT_ONE_SECOND      = 1000;
    private long    TIMEOUT_TEN_SECONDS     = 10 * TIMEOUT_ONE_SECOND;
    private long    TIMEOUT_ONE_MINUTE      = 60 * TIMEOUT_ONE_SECOND;
    private long    TIMEOUT_FIVE_MINUTES    = 5  * TIMEOUT_ONE_MINUTE;
    private long    TIMEOUT_TEN_MINUTES     = 10 * TIMEOUT_ONE_MINUTE;

Can someone have a look at the above and let me know what the problem might
be and how do I fix it??


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message