Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-838

[camel-smpp] jsmpp library AbstractSessionContext throws ConcurrentModificationException and causes thread leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • None
    • 2.10.0-fuse-71-047
    • None
    • None
    • Hide

      1. download SMSC simulator from here: http://www.seleniumsoftware.com/downloads.html
      2. rebuild attached smpp-bundle test case and deploy it to Fuse ESB 7.1.0 container.
      3. send following message to activemq broker "input" queue:

      <SMSObject>
          <messageReference>12345</messageReference>
          <smsOutboundRequest>test request</smsOutboundRequest>
      </SMSObject>
      

      4. stop the SMSC simulator and after 5 or 6 seconds, restart the simulator. Keeps doing so, you will see the number of thread pools keeps increasing like:
      "pool-28-thread-1"
      "pool-29-thread-1"
      ...

      Show
      1. download SMSC simulator from here: http://www.seleniumsoftware.com/downloads.html 2. rebuild attached smpp-bundle test case and deploy it to Fuse ESB 7.1.0 container. 3. send following message to activemq broker "input" queue: <SMSObject> <messageReference>12345</messageReference> <smsOutboundRequest>test request</smsOutboundRequest> </SMSObject> 4. stop the SMSC simulator and after 5 or 6 seconds, restart the simulator. Keeps doing so, you will see the number of thread pools keeps increasing like: "pool-28-thread-1" "pool-29-thread-1" ...

    Description

      The camel-smpp component uses jsmpp library: https://code.google.com/p/jsmpp/

      The org.jsmpp.session.AbstractSessionContext uses ArrayList and also does add, remove and change items of the list. It causes ConcurrentModificationException to be thrown during runtime and as a result thread leaks.

      I'll attach a new version of AbstractSessionContext.java to this ticket. Comparing to the original version, below are what I changed:
      1. added synchronized(sessionStateListeners) to three methods:
      addSessionStateListener
      removeSessionStateListener
      fireStateChanged

      2. replaced ArrayList with CopyOnWriteArrayList.

      Initial test result showed that it fixed the thread leak problem.

      Attachments

        1. AbstractSessionContext.java
          3 kB
          Joe Luo
        2. patch.txt
          2 kB
          Joe Luo

        Activity

          People

            willem.jiang Willem Jiang (Inactive)
            rhn-support-qluo Joe Luo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: