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

Bug: Unique Endpoints Leaking in DefaultInflightRepository

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.2, 2.10.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      If you have an endpoint protocol which uses unique URIs you will leak Strings in the HashMap stored in the DefaultInflightRepository (org.apache.camel.impl.DefaultInflightRepository)

      It seems there is a reference counting scheme in place, but it doesn't do a remove until the "stop" method is called to shut the system down. We are running XMPP endpoints, which use a protocol like xmpp://someaccount@domain/password?to=someOtherAccount
      When there are 10 million accounts, not all of which are active, but all of which may message at some time or another, no references are removed to the endpointCount.

      When the count becomes 0, the reference should be removed and the size method will still return the appropriate result.

      Please be careful in the implementation to synchronize on some object (perhaps the AtomicInteger) reflecting a read/write lock on the endpoint count modification.

        Attachments

        1. fixLeak.diff
          6 kB
          Zach Calvert
        2. fixLeak.diff
          6 kB
          Zach Calvert

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              zilatica Zach Calvert
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified