eclipse-ee4j / glassfish-shoal

Shoal
Other
5 stars 9 forks source link

Dangling Threads Prevent Graceful JVM Shutdown #113

Closed glassfishrobot closed 12 years ago

glassfishrobot commented 13 years ago

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.

Affected Versions

[1.1]

glassfishrobot commented 6 years ago
glassfishrobot commented 13 years ago

@glassfishrobot Commented Reported by erich_liebmann

glassfishrobot commented 12 years ago

@glassfishrobot Commented shreedhar_ganapathy said: Transferring to Joe for eval and closure.

glassfishrobot commented 12 years ago

@glassfishrobot Commented @jfialli said: 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.

glassfishrobot commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA SHOAL-113

glassfishrobot commented 12 years ago

@glassfishrobot Commented Marked as fixed on Wednesday, November 9th 2011, 1:03:39 pm