Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1516

Ironjacamar naming introduced a thread which can not be stopped during server shutdown

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.5.21.Final
    • Fungal
    • None

      Hi team. 

      We are using iron jacamar in our project. And we detected that, it introduced two threads indirectly to our system which can not be stopped during server shutdown process. 

      Background : 

      1) iron jacamar triggered jnpserver. 
      -------
      void com.github.fungal.impl.KernelImpl.startup()
      void org.jboss.jca.embedded.EmbeddedJCA.startup()
      void com.successfactors.sftomcat.EmbeddedIronJacamarInit.startContainer()
      -------
      void org.jnp.server.Main.start()
      Object jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
      Object jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Object, Object[])
      Object jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[])
      Object java.lang.reflect.Method.invoke(Object, Object[])
      Object com.github.fungal.impl.BeanDeployer.createBean(Bean, ClassLoader)
      void com.github.fungal.impl.BeanDeployer.run()

      2) jnpserver created two threads
      RMI Reaper
      -------
      void sun.rmi.transport.ObjectTable.putTarget(Target)
      void sun.rmi.transport.Transport.exportObject(Target)
      void sun.rmi.transport.tcp.TCPTransport.exportObject(Target)
      void sun.rmi.transport.tcp.TCPEndpoint.exportObject(Target)
      void sun.rmi.transport.LiveRef.exportObject(Target)
      Remote sun.rmi.server.UnicastServerRef.exportObject(Remote, Object, boolean) 
      Remote java.rmi.server.UnicastRemoteObject.exportObject(Remote, UnicastServerRef)
      Remote java.rmi.server.UnicastRemoteObject.exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
      void org.jnp.server.Main.initJnpInvoker() 
      void org.jnp.server.Main.start()

      pool-2-thread-1
      -------
      boolean java.util.concurrent.ThreadPoolExecutor.addWorker(Runnable, boolean)
      void java.util.concurrent.ThreadPoolExecutor.execute(Runnable)
      void org.jnp.server.Main.initBootstrapListener()
      void org.jnp.server.Main.start()

      Code analysis 

      1, the threads are created by org.jnp.server.Main from lib org.jboss.naming:jnpserver-5.0.3.GA.jar
      2, The thread pool is defined and injected from bean xml.

      https://github.com/ironjacamar/ironjacamar/blob/1.5.12.Final/embedded/impl/src/main/resources/naming.xml#L5

      Requirement

      Could you please check if it is possible to make the started threads daemon, or have a way to let them respect shutdown hook, once inro jacamar function is stopped then these two threads can also be stopped. 

       

              tadamski@redhat.com Tomasz Adamski
              felix_zhang Felix Zhang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: