Issue
Symptoms
MID Server Windows Service stops after 30 seconds or more instead of within a few seconds
Wrapper.log shows the following:
2019/06/13 10:42:02 | Stopping the ServiceNow MID Server_ACME MID Server 1 service...
2019/06/13 10:42:07 | Waiting to stop...
2019/06/13 10:42:12 | Waiting to stop...
2019/06/13 10:42:18 | Waiting to stop...
2019/06/13 10:42:23 | Waiting to stop...
2019/06/13 10:42:28 | Waiting to stop...
2019/06/13 10:42:33 | Waiting to stop...
2019/06/13 10:42:38 | Waiting to stop...
2019/06/13 10:42:43 | Waiting to stop...
2019/06/13 10:42:48 | Waiting to stop...
2019/06/13 10:42:53 | Waiting to stop...
2019/06/13 10:42:58 | Waiting to stop...
2019/06/13 10:43:03 | Waiting to stop...
2019/06/13 10:43:08 | Waiting to stop...
2019/06/13 10:43:13 | Waiting to stop...
2019/06/13 10:43:18 | Waiting to stop...
2019/06/13 10:43:23 | Waiting to stop...
2019/06/13 10:43:28 | Waiting to stop...
2019/06/13 10:43:33 | Waiting to stop...
2019/06/13 10:43:38 | Waiting to stop...
2019/06/13 10:43:43 | Waiting to stop...
2019/06/13 10:43:48 | Waiting to stop...
2019/06/13 10:43:53 | Waiting to stop...
2019/06/13 10:43:58 | Waiting to stop...
2019/06/13 10:44:03 | Waiting to stop...
2019/06/13 10:44:08 | Waiting to stop...
2019/06/13 10:44:13 | Waiting to stop...
2019/06/13 10:44:14 | Shutdown failed: Timed out waiting for signal from JVM.
2019/06/13 10:44:15 | JVM did not exit on request, termination requested.
2019/06/13 10:44:15 | JVM exited after being requested to terminate.
2019/06/13 10:44:15 | <-- Wrapper Stopped
Release
All
Cause
This is normal behavior for Java and the Java Service Wrapper on Windows
Resolution
If the MID Server is Madrid release, and the timeout was just over 2 minutes, as in the example above, then this known problem may be the cause:
KB0754285 / PRB1322060 MID Server Stop or Restart takes over 2 minutes longer due to a JMX thread remaining running - "Shutdown failed: Timed out waiting for signal from JVM"
If not, you may try adding the following in your wrapper-override.conf file:
wrapper.shutdown.timeout
The default value is 30 seconds and you might want to change this value based on the behavior you see on your Windows server.
- Fine the wrapper-override.conf file. You'll find the file in a typical install location like C:\ServiceNow\MID Server1\agent\conf
- Add the line above
- Restart the MID Server Windows Service
Warning: The wrapper.conf file should be left alone. Only make changes to wrapper-override.conf
A usual startup of the MID Server Windows Service would show this in the wrapper.log
Additional Information
You can read about the wrapper.shutdown.timeout property here:
https://wrapper.tanukisoftware.com/doc/english/prop-shutdown-timeout.html.
You can also read about the "wrapper.jvm_exit.timeout" here:
https://wrapper.tanukisoftware.com/doc/english/prop-jvm-exit-timeout.html