While trying to verify
GLASSFISH-20296, we found that endpointDeactivation may not be called during application undeployment intermittently.
We (Jagadish and I) think this could be due to a concurrency issue in AsynClientShutdownTask in
- In a multi-core laptop (Dell XPS) run the following
Uncomment the lookup logic in endpointDeactivation in ra/src/connector/SimpleResourceAdapterImpl.java of https://svn.java.net/svn/glassfish~svn/trunk/v2/appserv-tests/devtests/connector/v3/connector1.6, and run the test "ant all".
- observe that the endpointDeactivation is not called.
[actually you should be able to use any MDB test that uses a resource adapter to deliver messages. Undeploy the application that uses the RA, and check if endpointDeactivation is called.]
If you set a breakpoint in AsyncClientShutdownTask.run() you can observe that the MessageBeanCllient.close() – which would actually call the RA's endpointDeactivation in the connector's code – is not called intermittently.
Making the "done" local variable in AsyncClientShutdownTask "volatile" appears to fix the issue.
If you can't seem to reproduce the issue, and would like to have us (Jagadish/I) verify your fixes, please let us know. We can reproduce this issue fairly reguarly.