2 Replies Latest reply on Oct 16, 2014 10:43 PM by Tomohisa igarashi

    How to shutdown JMS client threads safely?

    Tomohisa igarashi Master

      Hi,

       

      I always see this error from exec-maven-plugin complaining HornetQ client threads is remaining even if connection is closed:

      [WARNING] thread Thread[Thread-0 (HornetQ-client-global-threads-1680046952),5,HornetQ-client-global-threads-1680046952] was interrupted but is still alive after waiting at least 15000msecs

      [WARNING] thread Thread[Thread-0 (HornetQ-client-global-threads-1680046952),5,HornetQ-client-global-threads-1680046952] will linger despite being asked to die via interruption

      [WARNING] thread Thread[Thread-0 (HornetQ-client-global-scheduled-threads-953129585),5,HornetQ-client-global-scheduled-threads-953129585] will linger despite being asked to die via interruption

      [WARNING] thread Thread[Thread-1 (HornetQ-client-global-scheduled-threads-953129585),5,HornetQ-client-global-scheduled-threads-953129585] will linger despite being asked to die via interruption

      [WARNING] NOTE: 3 thread(s) did not finish despite being asked to  via interruption. This is not a problem with exec:java, it is a problem with the running code. Although not serious, it should be remedied.

      [WARNING] Couldn't destroy threadgroup org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=com.github.igarashitm.switchyard_issues.SWITCHYARD_2404.JMSClient,maxpri=10]

      java.lang.IllegalThreadStateException

          at java.lang.ThreadGroup.destroy(ThreadGroup.java:775)

          at java.lang.ThreadGroup.destroy(ThreadGroup.java:792)

          at org.codehaus.mojo.exec.ExecJavaMojo.execute(ExecJavaMojo.java:328)

          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)

          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)

          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)

          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)

          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)

          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)

          at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)

          at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)

          at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:606)

          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

          at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

       

      Is there any way to avoid this? the reproducer for HORNETQ-1435 also shows above.

      [HORNETQ-1435] lot of WARN from NioEventLoop: Selector.select() returned prematurely 512 times in a row; rebuilding sele…

       

      Thanks,

      Tomo