Currently, when an IOException occurs or subclasses, these errors are ignored in implementations of TCPClient interface: BinaryTCPClientImpl: - SocketTimeoutException is ignored => an incomplete result is returned - InterruptedIOException is ignored => an incomplete result is returned - IOException is handled => an empty result is returned (sampler interprets it as OK response) resulting in Samplers Same for TCPClientImpl, and for LengthPrefixedBinaryTCPClientImpl it ignores IOException and returns incomplete response.
Also fixed NPE in TCPSampler: if an exception occurs , setSoTimeout will throw NPE if init fails Date: Thu Oct 27 20:45:11 2011 New Revision: 1190014 URL: http://svn.apache.org/viewvc?rev=1190014&view=rev Log: Bug 52104 - TCP Sampler handles badly errors Modified: jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImpl.java jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClient.java jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java jakarta/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java jakarta/jmeter/trunk/xdocs/changes.xml
I'm not sure it's the best solution to throw an IOException on read() errors If a response is truncated or otherwise incomplete, it might still contain useful information. This information was previously returned. Maybe there should be some kind of status code returned from read (e.g. Throwable?) Perhaps this could be a separate method (with default implementation in the abstract class). Thoughts?
See also Bug 52087
(In reply to comment #2) > I'm not sure it's the best solution to throw an IOException on read() errors > > If a response is truncated or otherwise incomplete, it might still contain > useful information. This information was previously returned. > But Sample was marked OK while it was in Error. > Maybe there should be some kind of status code returned from read (e.g. > Throwable?) I don't understand what you mean. Do you want to provide what was partially read ? > > Perhaps this could be a separate method (with default implementation in the > abstract class). > > Thoughts?
Yes, I think it would be useful to provide the partial response, but it should be marked as in error.
Date: Thu Nov 10 08:25:32 2011 New Revision: 1200210 URL: http://svn.apache.org/viewvc?rev=1200210&view=rev Log: Bug 52104 - TCP Sampler handles badly errors Bug 52087 - TCPClient interface does not allow for partial reads Added: jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/ReadException.java (with props) Modified: jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/LengthPrefixedBinaryTCPClientImpl.java jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClient.java jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/TCPSampler.java jmeter/trunk/xdocs/changes.xml
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2628