Bug 51841 - JMS : If an error occurs in ReceiveSubscriber constructor or Publisher, then Connections will stay open
Summary: JMS : If an error occurs in ReceiveSubscriber constructor or Publisher, then ...
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.5
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-17 21:07 UTC by Philippe Mouawad
Modified: 2011-09-17 21:47 UTC (History)
1 user (show)



Attachments
Fix to the issue (6.17 KB, patch)
2011-09-17 21:11 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2011-09-17 21:07:52 UTC
Hello,
I noticed this bug while working on issue 51691.
I had issue in authentication, so connection got created but the session fails.
So Object was not constructed but connection was and since ReceiveSubscriber or Publisher are not created, they cannot be destroyed.

I fixed this by checking in constructors that init goes to the end, if not I destroy object.

Regards
Philippe
Comment 1 Philippe Mouawad 2011-09-17 21:11:52 UTC
Created attachment 27524 [details]
Fix to the issue
Comment 2 Sebb 2011-09-17 21:47:34 UTC
Thanks!

There was strange item in the patch:

         Utils.close(SUBSCRIBER, log);
+        Utils.close(SUBSCRIBER, log);
         Utils.close(SESSION, log);
         Utils.close(CONN, log);

I assume the second call to close SUBSCRIBER was not intentional.

URL: http://svn.apache.org/viewvc?rev=1172073&view=rev
Log:
Bug 51841 - JMS : If an error occurs in ReceiveSubscriber constructor or Publisher, then Connections will stay open

Modified:
   jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/Publisher.java
   jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/ReceiveSubscriber.java
   jakarta/jmeter/trunk/xdocs/changes.xml
Comment 3 The ASF infrastructure team 2022-09-24 20:37:46 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2547