[jira] Created: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
Patch to enable executing thread to return immediately when process is "killed" by a watchdog
---------------------------------------------------------------------------------------------

                 Key: EXEC-41
                 URL: https://issues.apache.org/jira/browse/EXEC-41
             Project: Commons Exec
          Issue Type: Improvement
    Affects Versions: 1.0, 1.1
         Environment: Windows XP
            Reporter: Ernest Mishkin
            Priority: Minor
             Fix For: 1.1
         Attachments: commons-exec.patch

This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.

The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.

Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/EXEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ernest Mishkin updated EXEC-41:
-------------------------------

    Attachment: commons-exec.patch

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Konrad Windszus commented on EXEC-41:
-------------------------------------

Especially the bugfix for DefaultExecuteHandler.setExitValues should be applied soon, since this bug prevents disabling of exit value checking with giving null as parameter.

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Siegfried Goeschl commented on EXEC-41:
---------------------------------------

+) I tested Ernest patch a while ago but it did not solve the problem - since then I was a bit side-tracked
+) DefaultExecuteHandler.setExitValues(int[]) is already fixed
+) commons-exec-1.0.1 is actually available on the M2 repo (need to solve another infra problem before announcing the the release)

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Siegfried Goeschl commented on EXEC-41:
---------------------------------------

Found a bug in the patch and now it works - having said that, using setAlwaysWaitForStreamThreads(false) is for the desperate because it could leave up to three worker threads behind.

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/EXEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl resolved EXEC-41.
-----------------------------------

    Resolution: Fixed

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/EXEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl reopened EXEC-41:
-----------------------------------


Testing under Windows showed that the patch does not solve the problem - with the patch applied the code now hangs now in DefaultExecutor.closeStreams() until the process (and its children) are terminated. Created a patch with the modifications and reverted them for the code under version control.

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/EXEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl updated EXEC-41:
----------------------------------

    Attachment: EXEC-41.patch

Reverted changes when trying to fix EXEC-41

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch, EXEC-41.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (EXEC-41) Patch to enable executing thread to return immediately when process is "killed" by a watchdog

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/EXEC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Siegfried Goeschl resolved EXEC-41.
-----------------------------------

    Resolution: Won't Fix

> Patch to enable executing thread to return immediately when process is "killed" by a watchdog
> ---------------------------------------------------------------------------------------------
>
>                 Key: EXEC-41
>                 URL: https://issues.apache.org/jira/browse/EXEC-41
>             Project: Commons Exec
>          Issue Type: Improvement
>    Affects Versions: 1.0, 1.1
>         Environment: Windows XP
>            Reporter: Ernest Mishkin
>            Assignee: Siegfried Goeschl
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: commons-exec.patch, EXEC-41.patch
>
>
> This has been discussed on the commons-users mailing list. The patch intends to solve the following problem:
> when a process runs longer than allowed by a configured watchdog's timeout, the watchdog tries to destroy it and then DefaultExecutor tries to clean up by joining with all installed pump stream threads. Problem is, that sometimes the native process doesn't die and thus streams aren't closed and the stream threads do not complete.
> The patch provides setAlwaysWaitForStreamThreads(boolean) method in PumpStreamHandler. By default, alwaysWaitForStreamThreads is set to true to preserve the current behavior. If set to false, and process is killed by watchdog, DefaultExecutor's call into ErrorStreamHandler.stop will NOT join the stream threads and DefaultExecutor will NOT attempt to close the streams, so the executor's thread won't get stuck.
> Additionally, this patch fixes a small but annoying bug in DefaultExecuteHandler.setExitValues(int[])

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