[SHOAL-113] Dangling Threads Prevent Graceful JVM Shutdown Created: 15/Dec/10  Updated: 09/Nov/11  Resolved: 09/Nov/11

Status: Closed
Project: shoal
Component/s: GMS
Affects Version/s: 1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: erich_liebmann Assignee: Joe Fialli
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We experience problems to gracefully shutdown the JVM because Shoal does not terminate all non-deamon threads upon shutdown.

We initiate Shoal shutdown via the following API call but this does not terminate the GMSContext "viewWindowThread" and "messageWindowThread" and the Router "signalHandlerThread" (non-daemon) threads.

haGroupManagementService.shutdown(shutdownType.INSTANCE_SHUTDOWN);

To work around this problem we had to implement the following hack:

haGroupManagementService.shutdown(shutdownType.INSTANCE_SHUTDOWN);
DirectFieldAccessor gmsContextDirectFieldAccessor = new DirectFieldAccessor(gmsContext);
gmsContextDirectFieldAccessor.setPropertyValue("shuttingDown", true);
((Thread)gmsContextDirectFieldAccessor.getPropertyValue("viewWindowThread")).interrupt();
((Thread)gmsContextDirectFieldAccessor.getPropertyValue("messageWindowThread")).interrupt();

Router router = gmsContext.getRouter();
DirectFieldAccessor routerDirectFieldAccessor = new DirectFieldAccessor(router);
((Thread)routerDirectFieldAccessor.getPropertyValue("signalHandlerThread")).interrupt();

Kindly fix this shutdown issue. Please let me know should you require a proper source code patch for this.



 Comments   
Comment by shreedhar_ganapathy [ 09/Nov/11 ]

Transferring to Joe for eval and closure.

Comment by Joe Fialli [ 09/Nov/11 ]

this shoal gms issue would prevent glassfish v2 and v3.1 and higher application server from exiting.
It has been fixed in all versions of shoal gms.

Generated at Fri Mar 27 11:59:21 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.