How to stop JGroups threads when exit servlet

Help
Simon Chou
2006-04-03
2012-09-06
  • Simon Chou

    Simon Chou - 2006-04-03

    I have a servlet that uses JGroups JChannel. When this servlet is to be taken out of Tomcat, e.g. when shutting down Tomcat, those JGroups threads persist and cause Tomcat to hang. Is there a way to stop the JGroups threads in servlet upon shutdown?

    Knowing that most of the containers does not tolerate threads started by the components, such as EJB or servlet, should EJB or servlet use JGroups directly?

     
    • Simon Chou

      Simon Chou - 2006-04-06

      Here is the stack configuration...
      <config>
      <UDP mcast_addr="228.8.8.8"
      mcast_port="45828"
      bind_addr="172.20.2.33"
      ip_ttl="32"
      mcast_send_buf_size="150000"
      mcast_recv_buf_size="80000"/>
      <PING timeout="2000"
      num_initial_members="3"/>
      <MERGE2 min_interval="5000"
      max_interval="10000" />
      <FD_SOCK/>
      <VERIFY_SUSPECT timeout="1500" />
      <UNICAST timeout="5000" />
      <FRAG frag_size="8192"
      down_thread="false"
      up_thread="false"/>
      <TOTAL_TOKEN block_sending="50"
      unblock_sending="10"/>
      <pbcast.GMS join_timeout="5000"
      join_retry_timeout="2000"
      shun="false"
      print_local_addr="true"/>
      <STATE_TRANSFER/>
      <QUEUE/>
      </config>

       
    • Bela Ban

      Bela Ban - 2006-04-04

      You should call Channel.close() in this case

       
    • Simon Chou

      Simon Chou - 2006-04-06

      The JChannel.close() was called. It is the Promise.doWait() that hangs the Tomcat shutdown. Promise.doWait() is called because the JChannel.disconnect() is invoked, which itself is called by the JChannel.close().

      It appears that Promise.doWait() waits forever until some thing else to wake it up. But nothing comes to wake it up. Do you know what is supposed to come to wake up the Promise.doWait()?

       
      • Bela Ban

        Bela Ban - 2006-04-06

        The Channel.disconnect() should get a DISCONNECT_OK from the transport, which causes it to terminate the wait. What is your stack configuration ?

         
  • Anonymous - 2010-08-23

    Did you ever figure this one out?

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks