Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9738

Thread leak for camel-mina2 consumers

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      The camel-mina2 consumer (org.apache.camel.component.mina2.Mina2Consumer.doStart()) internally start a Mina2 IoAcceptor (org.apache.mina.core.service.IoAcceptor), but the org.apache.camel.component.mina2.Mina2Consumer.doStop() do not invoke acceptor.dispose(true); to release the threadpool started by Mina2.

      Current behavior: While stopping the web application, the threadpool started by Mina2 IoAcceptor will not be stopped, so we have several thread which do not properly shutdown.

      Current workaround: I create custom CamelShutdownStrategy and collect all Mina2Consumer and invoke Mina2consumer.getAcceptor.dispose(true); OR as an alternative create a dedicated consumer and overwrite the stop method of the Mina2 consumer as seen here: https://github.com/oehf/ipf/commit/12fdde8df7ebbbb7cd9966aadeab3ea3bed8fe75

      Suggested bugfix: In org.apache.camel.component.mina2.Mina2Consumer.doShutdown() call the IoAcceptor dispose(true) method after unbind from the address.

      Attachments

        1. ConsumerDispose.patch
          0.5 kB
          Thomas Papke

        Activity

          People

            acosentino Andrea Cosentino
            thopap Thomas Papke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: