Re: Read timeout doesn't seem to work
Marc Holden <[email protected]> Mon, 17 Nov 2014 12:06:57 -0500
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <CADV_OVWXWpp8Y+ONavWQjoeAtsvc8B1HeTv_DiOMPq6GEy78qA@mail.gmail.com> |
Wow, sorry about the reply... Gmail opted to send an unfinished message....
So per the javadoc, if data is tricking in before the timeout expires, then
the timer will get reset. See net.grinder.plugin.http.HTTPPluginConnection
It may be worth running wireshark or tcpdump or similar to make sure no
data is arriving within the timeout period.
Thanks,
-Marc
/**
* Sets the timeout to be used for creating connections and
* reading responses.
*
* <p>Setting the timeout to anything other than {@code 0}
* will cause additional threads to be spawned for each HTTP
* request made.</p>
*
* <p>When a timeout expires the operation will throw a
* {@link TimeoutException}.</p>
*
* <P>When creating new sockets the timeout will limit the time spent
* doing the host name translation and establishing the connection with
* the server.</p>
*
* <P>The timeout also influences the reading of the response
* headers. However, it does not specify a how long, for example,
* {@link HTTPClient.HTTPResponse#getStatusCode} may take, as
* might be assumed. Instead it specifies how long a read on the
* socket may take.* If the response dribbles in slowly with*
* * packets arriving quicker than the timeout then the method will*
* * complete normally. I.e. the exception is only thrown if nothing*
* * arrives on the socket for the specified time. Furthermore, the*
* * timeout only influences the reading of the headers, not the*
* * reading of the body.*</p>
*
* <P>Read timeouts are associated with responses, so that you may
* change this value before each request and it won't affect the
* reading of responses to previous requests.</p>
*
* @param timeout the time in milliseconds. A time of 0 means wait
* indefinitely.
*/
void setTimeout(int timeout);
On Mon, Nov 17, 2014 at 12:02 PM, Marc Holden <[email protected]> wrote:
> Hi Gary,
>
> Per the javadoc for setTimeout
>
>
> On Mon, Nov 17, 2014 at 11:37 AM, Gary Mulder <[email protected]>
> wrote:
>
>> Hi guys,
>>
>> I seem to have HTTP requests hanging on reading from the network, even
>> though I've set HTTPPluginControl setTimeout to 500ms. Due to the
>> non-functional failure testing I am doing, the System Under Test (SUT) will
>> sometimes take extended amounts of times (> 30 secs) to complete sending
>> responses to Grinder HTTP requests, if at all.
>>
>> Grinder is correctly throwing a TimeoutException when it can't connect at
>> all to the SUT, but it seems to simply hang if the connection is
>> successful, but the socket read never completes. A thread dump of the
>> Grinder worker indicates that the Grinder http threads are Runnable (see
>> below).
>>
>> I found an old bug (http://sourceforge.net/p/grinder/bugs/148/) that
>> seems to describe what I am seeing, but it dates from 2009.
>>
>> 2014-11-17 16:13:54,399 INFO go-agent2-0 : The Grinder version 3.11
>>
>> 2014-11-17 16:13:54,410 INFO go-agent2-0 : Java(TM) SE Runtime
>> Environment 1.7.0_65-b17: Java HotSpot(TM) 64-Bit Server VM (24.65-b04,
>> mixed mode) on Linux amd64 3.2.0-4-amd64
>>
>>
>> [...]
>>
>>
>> Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode):
>>
>>
>> "SocketTimeout" daemon prio=10 tid=0x00007fec7d36c000 nid=0x1440 waiting
>> on condition [0x00007fec58fbe000]
>>
>> java.lang.Thread.State: TIMED_WAITING (sleeping)
>>
>> at java.lang.Thread.sleep(Native Method)
>>
>> at HTTPClient.SocketTimeout.run(StreamDemultiplexor.java:924)
>>
>>
>> "Timer-0" daemon prio=10 tid=0x00007fec7da7a800 nid=0x143e in
>> Object.wait() [0x00007fec590bf000]
>>
>> java.lang.Thread.State: TIMED_WAITING (on object monitor)
>>
>> at java.lang.Object.wait(Native Method)
>>
>> - waiting on <0x0000000585a9b5e8> (a java.util.TaskQueue)
>>
>> at java.util.TimerThread.mainLoop(Timer.java:552)
>>
>> - locked <0x0000000585a9b5e8> (a java.util.TaskQueue)
>>
>> at java.util.TimerThread.run(Timer.java:505)
>>
>>
>> "Thread-1" daemon prio=10 tid=0x0000000001097800 nid=0x143d in
>> Object.wait() [0x00007fec591c0000]
>>
>> java.lang.Thread.State: WAITING (on object monitor)
>>
>> at java.lang.Object.wait(Native Method)
>>
>> - waiting on <0x00000005857d5868> (a java.lang.ref.ReferenceQueue$Lock)
>>
>> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
>>
>> - locked <0x00000005857d5868> (a java.lang.ref.ReferenceQueue$Lock)
>>
>> at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
>>
>> at
>> extra166y.CustomConcurrentHashMap$ReclamationThread.run(CustomConcurrentHashMap.java:1754)
>>
>>
>> "thread 4" daemon prio=10 tid=0x00007fec7d8b4800 nid=0x143c runnable
>> [0x00007fec592c0000]
>>
>> java.lang.Thread.State: RUNNABLE
>>
>> at java.net.SocketInputStream.socketRead0(Native Method)
>>
>> at java.net.SocketInputStream.read(SocketInputStream.java:152)
>>
>> at java.net.SocketInputStream.read(SocketInputStream.java:122)
>>
>> [...]
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
>> _______________________________________________
>> grinder-use mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/grinder-use
>>
>>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use