[ https://issues.apache.org/jira/browse/DAEMON-366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16062038#comment-16062038 ]
Bernd Eckenfels edited comment on DAEMON-366 at 6/24/17 3:53 PM: ----------------------------------------------------------------- I just diffed the releases and there is a change in this area, the global shutdown event which terminates the main service loop is set a bit later: http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_15/src/native/windows/apps/prunsrv/prunsrv.c?r1=1460101&r2=1461070&diff_format=h This is I guess a bugfix for a similiar issue (DAEMON-288) to allow a clean shutdown. However this does not look directly like the issue, but It might be possible that the shutdown event might be missed and the shutdown wont be forcefully. Can you provide us with a debug-level logfile of procrun? (--LogLevel=Debug) This is expected: "Waiting 1 minute for all threads to exit" http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?diff_format=h&revision=1461070&view=markup#l1559 this would block: "Waiting for all threads to exit" http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?diff_format=h&revision=1461070&view=markup#l1559 was (Author: b.eckenfels): I just diffed the releases and there is a change in this area, the global shutdown event which terminates the main service loop is set only after the JVM has exited. http://svn.apache.org/viewvc/commons/proper/daemon/tags/COMMONS_DAEMON_1_0_15/src/native/windows/apps/prunsrv/prunsrv.c?r1=1460101&r2=1461070&diff_format=h This is I guess a bugfix for a similiar issue (DAEMON-288) to allow a clean shutdown. It might be possible that the shutdown event might be missed and the shutdown wont be forcefully. Can you provide us with a debug-level logfile of procrun? (--LogLevel=Debug) This is expected: "Waiting 1 minute for all threads to exit" http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?diff_format=h&revision=1461070&view=markup#l1559 this would block: "Waiting for all threads to exit" http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?diff_format=h&revision=1461070&view=markup#l1559 , but it has the consequence that it wont anymore forcefully terminate your service. If I see it right it will set the event after the stop timeout, so try setting the stop timeout to something a bit smaller than the windows service manager timeout of 30s. > Windows service fails to stop with error code 1053 (using Windows 7 service > manager) > ------------------------------------------------------------------------------------ > > Key: DAEMON-366 > URL: https://issues.apache.org/jira/browse/DAEMON-366 > Project: Commons Daemon > Issue Type: Bug > Components: Procrun > Affects Versions: 1.0.15 > Environment: Windows 7 64bit - using 64-bit prunsrv.exe in jvm mode > Using 64-bit Java JRE 1.8.0_73 > Reporter: Consultant Leon > Assignee: Guillaume Chauvet > Labels: prunsrv, stop, windows > > Using Windows services manager (services.msc) to start/stop service. > Service installed with the following start/stop settings. > --StartMode=jvm --StartClass=com.myorg.MyClass --StartMethod=start > --StopMode=jvm --StopClass=com.myorg.MyClass --StopMethod=stop > Service starts OK. > When I use services manager to stop the service, the application stops > running but the prunsrv.exe process does not terminate. > Eventually the services manager reports that: > "Windows could not stop the <MyServiceName> service on Local Computer. Error > 1053: The service did not respond to the start or control request in a timely > fashion." > The service then stays at status "stopping" & cannot be restarted without > first killing the prunsrv.exe process. > Looking at the application logs I can see that the application's stop() > method gets called - the final line in this method is a logging call which is > executing OK. > The commons-daemon-<date>.log file has the following entries: > [2013-05-09 17:18:02] [info] [10944] Commons Daemon procrun (1.0.15.0 > 32-bit) started > [2013-05-09 17:18:02] [info] [10944] Running '<MyServiceName>' Service... > [2013-05-09 17:18:02] [info] [ 9224] Starting service... > [2013-05-09 17:18:11] [info] [ 9224] Service started in 9202 ms. > [2013-05-09 17:18:23] [info] [10780] Stopping service... > [2013-05-09 17:18:24] [info] [10780] Service stop thread completed. > This problem does not occur in daemon versions 11->14. > I have only seen it in daemon-1.0.15 -- This message was sent by Atlassian JIRA (v6.4.14#64029)