Bug 44910 - TCP Sampler "isReUseConnection" issue.
Summary: TCP Sampler "isReUseConnection" issue.
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.3.1
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-30 05:34 UTC by Dmitry Kudrenko
Modified: 2008-04-30 05:45 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Kudrenko 2008-04-30 05:34:30 UTC
I tested application using JMeter TCP Sampler. This application closes session
when TCP Socket is closed.

But when I use the isReUseConnection flag - new connection is started
but old socket doesn't closed until JMeter is not closed.

TCPSampler closes connection in the finally block in the "sample" method if isReUseConnection set. But it closes new connection from the map but old connection is never closed.

I think connection should be closed every time when new connection created in the getSocket(). I added closeSocket() method to the getSocket() method:

  ...
  try {    // line 141
	closeSocket();
	con = new Socket(getServer(), getPort());
  ...

and it works for me correctly.

Thank you.
-- 
Regards,
Dmitry Kudrenko
ARDAS group http://ardas.dp.ua
Comment 1 Sebb 2008-04-30 05:45:54 UTC
Good catch.

Fix applied to SVN:

URL: http://svn.apache.org/viewvc?rev=652380&view=rev
Log:
Bug 44910 - close previous socket (if any) in TCP Sampler
Comment 2 The ASF infrastructure team 2022-09-24 20:37:41 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2105