[
https://issues.apache.org/jira/browse/NIFI-5196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16547154#comment-16547154
]
ASF GitHub Bot commented on NIFI-5196:
--------------------------------------
GitHub user mosermw opened a pull request:
https://github.com/apache/nifi/pull/2904
NIFI-5196 Fixed JMS connection leak when uncaught exceptions happen
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mosermw/nifi NIFI-5196
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/2904.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2904
----
commit 4d4ef545448223cf5cd9bceea1b7778fab535480
Author: Mike Moser <mosermw@...>
Date: 2018-07-17T21:20:47Z
NIFI-5196 Fixed JMS connection leak when uncaught exceptions happen
----
> AbstractJMSProcessor can leave connection hanging open
> ------------------------------------------------------
>
> Key: NIFI-5196
> URL: https://issues.apache.org/jira/browse/NIFI-5196
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.6.0
> Reporter: Nick Coleman
> Assignee: Sivaprasanna Sethuraman
> Priority: Major
> Labels: JMS
>
> ConsumeJMS and PublishJMS are based on AbstractJMSProcessor. They can cause
> a connection to the MQ Server to be opened and not be closed until the NiFi
> server is rebooted.
> This can create a problem for an MQ when the initial setup entered is wrong
> for an IBM MQ system that only allows one connection per user. Subsequent
> connections are blocked as the first remains open. Another potential problem
> even if the subsequent connection works is the original connection is still
> open and taking up resources.
> A simple change to the AbstractJMSProcessor would be in the onTrigger()
> function:
>
> {code:java}
> @Override
> public void onTrigger(ProcessContext context, ProcessSession session) throws
> ProcessException {
> T worker = workerPool.poll();
> if (worker == null) {
> worker = buildTargetResource(context);
> }
> boolean offered = false;
> try {
> rendezvousWithJms(context, session, worker);
> offered = workerPool.offer(worker);
> }
> finally {
> if (!offered) {
> worker.shutdown();
> }
> }
> }{code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)