Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-3582

SeBootstrap services crash on shutdown

XMLWordPrintable

      Starting with version 6.2.4.Final, code using SeBootstrap crashes on Ctrl+C, kill -15, etc. Preceding versions are fine. You should be able to reproduce it with the examples in your repo. Both options below crash

      SeBootstrap.start(restApplication, bootstrapConfiguration).thenAccept(
              applicationInstance -> {
                  applicationInstance.stopOnShutdown(stopResult -> {});
              });
      
      Thread.currentThread().join();
      
      SeBootstrap.start(restApplication, bootstrapConfiguration).thenAccept(
              applicationInstance -> {
                  Runtime.getRuntime().addShutdownHook(
                          new Thread(() -> applicationInstance.stop()));
              });
      
      ^CException in thread "Thread-0" java.lang.IllegalStateException: Shutdown in progress
          at java.base/java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:67)
          at java.base/java.lang.Runtime.addShutdownHook(Runtime.java:250)
          at org.jboss.resteasy.concurrent.SecurityActions.registerShutdownHook(SecurityActions.java:42)
          at org.jboss.resteasy.concurrent.GlobalContextualExecutorService.getDelegate(GlobalContextualExecutorService.java:81)
          at org.jboss.resteasy.concurrent.ContextualExecutorService.submit(ContextualExecutorService.java:137)
          at org.jboss.resteasy.core.se.ResteasySeInstance.stop(ResteasySeInstance.java:172)
          at io.antimetric.application.RestApplication.lambda$main$0(RestApplication.java:49)
          at java.base/java.lang.Thread.run(Thread.java:1583)
      

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: