Windows 3.2.0 wrapper stops but jvm does not

View: New views
2 Messages — Rating Filter:   Alert me  

Windows 3.2.0 wrapper stops but jvm does not

by Ryan Fong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

G'day, mates.  I'm having an odd problem in one of three programs that
use the wrapper.  I'd appreciate your advice & insight.

We're using version 3.2.0 of the wrapper on Windows with the wrapper.dll
library.  The wrapper is installed as a Windows service.  During an
upgrade, our InstallAnywhere 2008 program calls its routine to stop this
service and sometimes the service only takes 1 sec to shutdown instead
of 6 sec.  Using the wrapper debug log, I've determined that in this
condition the wrapperp sends "send a packet SERVICE_CONTROL_CODE : 1"
and then declares that "SmartPass stopped".  Normally there's a long set
of other activity.  In this condition, the wrapper process stops but the
child Java process does not.  In fact, the Java process is totally
unaware of the stop request and continues running.  This causes
installation problems.  The service uptime required to see this ranges
from 2 hours to 24 hours, so it's quite sporadic.

I suspect either one of the disabled timeout parameters below or some
wrapper bug is causing this problem.  However, the same settings are in
all of our programs and only this one is exhibiting a problem.

wrapper.ping.timeout=0
wrapper.shutdown.timeout=0

I've also noted that this program is using the Java 1.6.0_02 client VM
instead of the server VM and that we have not specified
-Djava.awt.headless=true

I reviewed the release notes for newer versions but didn't see any items
that matched my case.  Any help would be appreciated.  Thanks!


// failing, non-stopping case
DEBUG  | wrapperp | 2009/07/21 08:55:52 | send a packet PING : ping
INFO   | jvm 1    | 2009/07/21 08:55:52 | Received a packet PING : ping
INFO   | jvm 1    | 2009/07/21 08:55:52 | Send a packet PING : ok
INFO   | jvm 1    | 2009/07/21 08:55:52 | Non-daemon thread count = 18 -
1(system) = 17
DEBUG  | wrapperp | 2009/07/21 08:55:52 | read a packet PING : ok
DEBUG  | wrapper  | 2009/07/21 08:55:52 | Got ping response from JVM
STATUS | wrapper  | 2009/07/21 08:55:56 | Service is running.  Stopping
it...
DEBUG  | wrapperp | 2009/07/21 08:55:56 | send a packet
SERVICE_CONTROL_CODE : 1
STATUS | wrapper  | 2009/07/21 08:55:57 | SmartPass stopped.
STATUS | wrapper  | 2009/07/21 08:55:57 | SmartPass removed.


// normal stop case
DEBUG  | wrapperp | 2009/07/17 13:49:33 | send a packet PING : ping
INFO   | jvm 1    | 2009/07/17 13:49:33 | Received a packet PING : ping
INFO   | jvm 1    | 2009/07/17 13:49:33 | Send a packet PING : ok
INFO   | jvm 1    | 2009/07/17 13:49:33 | Non-daemon thread count = 18 -
1(system) = 17
DEBUG  | wrapperp | 2009/07/17 13:49:33 | read a packet PING : ok
DEBUG  | wrapper  | 2009/07/17 13:49:33 | Got ping response from JVM
DEBUG  | wrapperp | 2009/07/17 13:49:35 | send a packet
SERVICE_CONTROL_CODE : 1
DEBUG  | wrapper  | 2009/07/17 13:49:35 | ServiceControlHandler(1)
DEBUG  | wrapper  | 2009/07/17 13:49:35 |   SERVICE_CONTROL_STOP
DEBUG  | wrapper  | 2009/07/17 13:49:35 | wrapperStopProcess(0) called.
STATUS | wrapper  | 2009/07/17 13:49:35 | Service is running.  Stopping
it...
DEBUG  | wrapper  | 2009/07/17 13:49:35 | Sending stop signal to JVM
DEBUG  | wrapperp | 2009/07/17 13:49:35 | send a packet STOP : NULL
INFO   | jvm 1    | 2009/07/17 13:49:35 | Received a packet
SERVICE_CONTROL_CODE : 1
INFO   | jvm 1    | 2009/07/17 13:49:35 | Wrapper Manager:
ServiceControlCode from Wrapper with code 1
INFO   | jvm 1    | 2009/07/17 13:49:35 | Non-daemon thread count = 18 -
1(system) = 17
INFO   | jvm 1    | 2009/07/17 13:49:35 | Received a packet STOP :
INFO   | jvm 1    | 2009/07/17 13:49:35 | Thread, Wrapper-Connection,
handling the shutdown process.
INFO   | jvm 1    | 2009/07/17 13:49:35 | calling listener.stop()
INFO   | jvm 1    | 2009/07/17 13:49:37 | returned from listener.stop()
INFO   | jvm 1    | 2009/07/17 13:49:37 | Send a packet STOPPED : 0
DEBUG  | wrapperp | 2009/07/17 13:49:37 | read a packet STOPPED : 0
DEBUG  | wrapper  | 2009/07/17 13:49:37 | JVM signalled that it was
stopped.
INFO   | jvm 1    | 2009/07/17 13:49:37 | Closing socket.
DEBUG  | wrapperp | 2009/07/17 13:49:37 | socket read no code (closed?).
DEBUG  | wrapperp | 2009/07/17 13:49:38 | server listening on port
32001.
INFO   | jvm 1    | 2009/07/17 13:49:38 | calling System.exit(0)
DEBUG  | wrapper  | 2009/07/17 13:49:39 | JVM process exited with a code
of 0, leaving the wrapper exit code set to 0.
DEBUG  | wrapper  | 2009/07/17 13:49:39 | JVM exited normally.
STATUS | wrapper  | 2009/07/17 13:49:39 | <-- Wrapper Stopped
INFO   | wrapper  | 2009/07/17 13:49:40 | Waiting to stop...
STATUS | wrapper  | 2009/07/17 13:49:41 | SmartPass stopped.

------------------------------------------------------------------------------
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user

Re: Windows 3.2.0 wrapper stops but jvm does not

by Leif Mortenson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ryan,
I believe this is a problem that was fixed in version 3.2.2:
---
Fix a CRITICAL bug in the 3.2.0 and 3.2.1 Windows versions of the
Wrapper where the Wrapper would crash under rare circumstances when
running as a service. If the service manager interrogated the service
at the same instant as the wrapper was pinging the JVM, the wrapper
was sometimes crashing due to a synchronization problem. The problem
did not exist prior to 3.2.0. Bug #1574537.
---
The problem may not have always resulted in a crash.  See the release
notes for ta complete list of changes:
http://wrapper.tanukisoftware.org/doc/english/release-notes.html

Is it possible for you to use a newer version of the Wrapper?

The JVM side of the Wrapper has some code which will normally cause
the JVM to shut itself down after 30 seconds should it ever lose
contact with the Wrapper process.  In your case, this is not happening
because you have completely disabled the ping timeouts.  I would
suggest setting the wrapper.ping.timeout to a non-zero value.  If you
were having problems with timeouts, setting it to a long value like 5
minutes is still much more reliable than disabling the timeout all
together.

Let me know if I can help out further.

Cheers,
Leif

On Wed, Jul 22, 2009 at 1:20 AM, Ryan Fong<rfong@...> wrote:

> G'day, mates.  I'm having an odd problem in one of three programs that
> use the wrapper.  I'd appreciate your advice & insight.
>
> We're using version 3.2.0 of the wrapper on Windows with the wrapper.dll
> library.  The wrapper is installed as a Windows service.  During an
> upgrade, our InstallAnywhere 2008 program calls its routine to stop this
> service and sometimes the service only takes 1 sec to shutdown instead
> of 6 sec.  Using the wrapper debug log, I've determined that in this
> condition the wrapperp sends "send a packet SERVICE_CONTROL_CODE : 1"
> and then declares that "SmartPass stopped".  Normally there's a long set
> of other activity.  In this condition, the wrapper process stops but the
> child Java process does not.  In fact, the Java process is totally
> unaware of the stop request and continues running.  This causes
> installation problems.  The service uptime required to see this ranges
> from 2 hours to 24 hours, so it's quite sporadic.
>
> I suspect either one of the disabled timeout parameters below or some
> wrapper bug is causing this problem.  However, the same settings are in
> all of our programs and only this one is exhibiting a problem.
>
> wrapper.ping.timeout=0
> wrapper.shutdown.timeout=0
>
> I've also noted that this program is using the Java 1.6.0_02 client VM
> instead of the server VM and that we have not specified
> -Djava.awt.headless=true
>
> I reviewed the release notes for newer versions but didn't see any items
> that matched my case.  Any help would be appreciated.  Thanks!
>
>
> // failing, non-stopping case
> DEBUG  | wrapperp | 2009/07/21 08:55:52 | send a packet PING : ping
> INFO   | jvm 1    | 2009/07/21 08:55:52 | Received a packet PING : ping
> INFO   | jvm 1    | 2009/07/21 08:55:52 | Send a packet PING : ok
> INFO   | jvm 1    | 2009/07/21 08:55:52 | Non-daemon thread count = 18 -
> 1(system) = 17
> DEBUG  | wrapperp | 2009/07/21 08:55:52 | read a packet PING : ok
> DEBUG  | wrapper  | 2009/07/21 08:55:52 | Got ping response from JVM
> STATUS | wrapper  | 2009/07/21 08:55:56 | Service is running.  Stopping
> it...
> DEBUG  | wrapperp | 2009/07/21 08:55:56 | send a packet
> SERVICE_CONTROL_CODE : 1
> STATUS | wrapper  | 2009/07/21 08:55:57 | SmartPass stopped.
> STATUS | wrapper  | 2009/07/21 08:55:57 | SmartPass removed.
>
>
> // normal stop case
> DEBUG  | wrapperp | 2009/07/17 13:49:33 | send a packet PING : ping
> INFO   | jvm 1    | 2009/07/17 13:49:33 | Received a packet PING : ping
> INFO   | jvm 1    | 2009/07/17 13:49:33 | Send a packet PING : ok
> INFO   | jvm 1    | 2009/07/17 13:49:33 | Non-daemon thread count = 18 -
> 1(system) = 17
> DEBUG  | wrapperp | 2009/07/17 13:49:33 | read a packet PING : ok
> DEBUG  | wrapper  | 2009/07/17 13:49:33 | Got ping response from JVM
> DEBUG  | wrapperp | 2009/07/17 13:49:35 | send a packet
> SERVICE_CONTROL_CODE : 1
> DEBUG  | wrapper  | 2009/07/17 13:49:35 | ServiceControlHandler(1)
> DEBUG  | wrapper  | 2009/07/17 13:49:35 |   SERVICE_CONTROL_STOP
> DEBUG  | wrapper  | 2009/07/17 13:49:35 | wrapperStopProcess(0) called.
> STATUS | wrapper  | 2009/07/17 13:49:35 | Service is running.  Stopping
> it...
> DEBUG  | wrapper  | 2009/07/17 13:49:35 | Sending stop signal to JVM
> DEBUG  | wrapperp | 2009/07/17 13:49:35 | send a packet STOP : NULL
> INFO   | jvm 1    | 2009/07/17 13:49:35 | Received a packet
> SERVICE_CONTROL_CODE : 1
> INFO   | jvm 1    | 2009/07/17 13:49:35 | Wrapper Manager:
> ServiceControlCode from Wrapper with code 1
> INFO   | jvm 1    | 2009/07/17 13:49:35 | Non-daemon thread count = 18 -
> 1(system) = 17
> INFO   | jvm 1    | 2009/07/17 13:49:35 | Received a packet STOP :
> INFO   | jvm 1    | 2009/07/17 13:49:35 | Thread, Wrapper-Connection,
> handling the shutdown process.
> INFO   | jvm 1    | 2009/07/17 13:49:35 | calling listener.stop()
> INFO   | jvm 1    | 2009/07/17 13:49:37 | returned from listener.stop()
> INFO   | jvm 1    | 2009/07/17 13:49:37 | Send a packet STOPPED : 0
> DEBUG  | wrapperp | 2009/07/17 13:49:37 | read a packet STOPPED : 0
> DEBUG  | wrapper  | 2009/07/17 13:49:37 | JVM signalled that it was
> stopped.
> INFO   | jvm 1    | 2009/07/17 13:49:37 | Closing socket.
> DEBUG  | wrapperp | 2009/07/17 13:49:37 | socket read no code (closed?).
> DEBUG  | wrapperp | 2009/07/17 13:49:38 | server listening on port
> 32001.
> INFO   | jvm 1    | 2009/07/17 13:49:38 | calling System.exit(0)
> DEBUG  | wrapper  | 2009/07/17 13:49:39 | JVM process exited with a code
> of 0, leaving the wrapper exit code set to 0.
> DEBUG  | wrapper  | 2009/07/17 13:49:39 | JVM exited normally.
> STATUS | wrapper  | 2009/07/17 13:49:39 | <-- Wrapper Stopped
> INFO   | wrapper  | 2009/07/17 13:49:40 | Waiting to stop...
> STATUS | wrapper  | 2009/07/17 13:49:41 | SmartPass stopped.

------------------------------------------------------------------------------
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user