commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konrad Windszus (JIRA)" <j...@apache.org>
Subject [jira] Commented: (EXEC-44) ExecuteWatchdog should accept infinite timeouts (argument -1)
Date Thu, 20 May 2010 12:39:55 GMT

    [ https://issues.apache.org/jira/browse/EXEC-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869589#action_12869589
] 

Konrad Windszus commented on EXEC-44:
-------------------------------------

Even worse is that I can't provide a value like Long.MAX_VALUE for the timeout since this
would lead to an overflow in Watchdog.run 
{code}
public synchronized void run() {
        final long until = System.currentTimeMillis() + timeout;
        long now;
        while (!stopped && until > (now = System.currentTimeMillis())) {
            try {
                wait(until - now);
            } catch (InterruptedException e) {
            }
        }
        if (!stopped) {
            fireTimeoutOccured();
        }
    }
{code}
The until variable would then get negative, which means that the process is interrupted immediately.

> ExecuteWatchdog should accept infinite timeouts (argument -1)
> -------------------------------------------------------------
>
>                 Key: EXEC-44
>                 URL: https://issues.apache.org/jira/browse/EXEC-44
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0.1
>            Reporter: Konrad Windszus
>            Assignee: Siegfried Goeschl
>
> Because the ExecuteWatchdog is the only way to destroy asynchronous processes, it should
be possible to set it to an infinite timeout, for processes which should not timeout, but
manually destroyed under some circumstances.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message