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

Mladen Turk commented on DAEMON-302:
------------------------------------

Since 'normal' jvm operation can return non zero exit codes (depending on the 
application itself)
we cannot use that. Our 'VM exit code' only reflects the errors in starting VM.
>From Commons Daemon perspective the VM exited cleanly since main() terminated.

Anyhow, I think no one should ever try to auto restart crashed VM.
Not sure if JNI core produces special VM exit code. If it does we could use 
that as config param filter value for reportServiceStatus
                
> Service recovery options do not work when a JNI crash brings down the JVM
> -------------------------------------------------------------------------
>
>                 Key: DAEMON-302
>                 URL: https://issues.apache.org/jira/browse/DAEMON-302
>             Project: Commons Daemon
>          Issue Type: Bug
>          Components: Procrun
>    Affects Versions: 1.0.15
>         Environment: Windows 7 64bit
> JRE 1.7.0_25-b17 (64bit)
>            Reporter: Iain Williams
>              Labels: jni, jvm, procrun, service
>
> We have a java application that we run as a service which has a C component 
> setup, and communicated to across the Java Native Interface. 
> If a crash occurs in the C component the whole JVM is brought down. However 
> this does not trigger the service recovery options to kick in.
> I believe this is due to a VM exit code of 0 (see bellow).
> [2013-06-27 11:55:47] [debug] ( prunsrv.c:1528) [ 8488] Waiting for worker to 
> finish...
> [2013-06-27 11:55:55] [debug] ( javajni.c:964 ) [ 5716] Java Worker thread 
> finished applicationName/core/applicationNameCore:main with status=0
> [2013-06-27 11:55:55] [debug] ( prunsrv.c:1533) [ 8488] Worker finished.
> [2013-06-27 11:55:55] [debug] ( prunsrv.c:1559) [ 8488] Waiting for all 
> threads to exit
> [2013-06-27 11:56:46] [debug] ( prunsrv.c:919 ) [10160] Start exit hook 
> called ...
> [2013-06-27 11:56:46] [debug] ( prunsrv.c:920 ) [10160] VM exit code: 0
> [2013-06-27 11:56:46] [debug] ( prunsrv.c:844 ) [10160] reportServiceStatusE: 
> 1, 0, 0, 0
> With a return code of 0, the SCM would think the service stopped safely, 
> without error, which is not the case here since the JNI has crashed.
> Is there anything that can be done about this?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to