Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6391

ConsumeJMS/PublishJMS - Excessive connections created when get/publish operations continually fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Done
    • 1.8.0
    • None
    • Extensions
    • None

    Description

      PublishJMS repeatedly threw "ResourceAllocationException: too many open connections" after successive publish failures due to issues on the remote JMS Broker. The cause of this is the specification and implementation of the JMSConnectionFactoryProviderDefinition.resetConnectionFactory(ConnectionFactory cf) method. Setting the ConnectionFactory to null may well indeed close connections upon 'destruction', but it may take awhile for the GC to run; in the meantime, more connections are opened. The connections need to be manually closed rather than waiting for a GC.

      From AbstractJMSProcessor.onTrigger(), need to call worker.shutdown() prior to resetConnectionFactory().

      Also, noticed some problems iwth the ConnectionFactoryProviderDefinition implementatoins wrt the resetConnectionFactory methods. The factory is nulled but never re-initialized but for onEnabled(); which will lead to a NPE at some point.

      Attachments

        Issue Links

          Activity

            People

              slyouts Steven Youtsey
              slyouts Steven Youtsey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m