shoal
  1. shoal
  2. SHOAL-113

Dangling Threads Prevent Graceful JVM Shutdown

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: GMS
    • Labels:
      None

      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.

        Activity

        Hide
        shreedhar_ganapathy added a comment -

        Transferring to Joe for eval and closure.

        Show
        shreedhar_ganapathy added a comment - Transferring to Joe for eval and closure.
        Hide
        Joe Fialli added a comment -

        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.

        Show
        Joe Fialli added a comment - 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.

          People

          • Assignee:
            Joe Fialli
            Reporter:
            erich_liebmann
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: