commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Ehrbar (Issue Comment Edited) (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (DAEMON-244) prunsrv does not propagate exit code
Date Fri, 16 Mar 2012 09:29:40 GMT

    [ https://issues.apache.org/jira/browse/DAEMON-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230989#comment-13230989
] 

Peter Ehrbar edited comment on DAEMON-244 at 3/16/12 9:29 AM:
--------------------------------------------------------------

I have attached a patch (to be applied on 1.0.10) that fixes the VM exit code propagation
so that it meets my requirements. With this patch, it is possible to terminate a VM with a
non-zero exit code, which is then detected and handled by the Windows Service Controller (e.g.
automatically restart the service).
                
      was (Author: peter.ehrbar):
    Patch on Rel 1.0.10 to handle propagation of VM exit code
                  
> prunsrv does not propagate exit code
> ------------------------------------
>
>                 Key: DAEMON-244
>                 URL: https://issues.apache.org/jira/browse/DAEMON-244
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.10
>         Environment: MS Windows
>            Reporter: Peter Ehrbar
>         Attachments: exit_code_patch_on_1_0_10.txt
>
>
> In order to perform recovery actions (e.g. restart service) the Windows Service Controller
needs to detect abnormal program terminations (failures). The Service controller detects a
failure if either the service process crashes or the process terminates with a non-zero exit
code.
> For my Java server application I want to define recovery actions for the following conditions:
> 1) VM crash
> 2) Error was thrown (e.g. OutOfMemoryError)
> 3) System.exit() with non-zero exit code
> When using prunsrv as a wrapper, I observe the following behaviour:
> 1) VM crash is detected only when StartMode=jvm, otherwise the Service Controller ignores
the failure situation
> 2) When an Error is thrown and StartMode=jvm, prunsrv does not terminate but seems to
hang. Therefore, the Service Controller is not aware of the failure. For other StartModes,
prunsrv terminates, but the Service Controller does not detect the failure.
> 3) When System.exit(42) is called, prunsrv terminates but the Service Controller does
not detect the non-zero exit code. This applies for all StartModes.
> It seems to me as if prunsrv always terminates with exit code zero. But I expect the
following behaviour:
> 1) VM crash with StartMode=jvm -> OK as it is now, but with other StartModes, prunsrv
should terminate with a non-zero exit code in order to indicate the abnormal termination.
> 2) When an Error is thrown, prunsrv should terminate with a non-zero exit code in order
to indicate the abnormal termination.
> 3) When System.exit() is called, prunsrv should terminate with the exit code passed to
System.exit() (transparent behaviour), in order to let the application indicate a failure
situation.
> With the current behaviour, it is not possible to let the Windows Service Controller
perform recovery actions.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message