You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlrpc-dev@ws.apache.org by rodneygomes <ro...@gmail.com> on 2008/01/11 02:32:53 UTC
Re: Client getting stuck in IO layer...
Not a single response in what half a year ? I still see this problem with
the same client and it just keeps getting stuck on the socketRead0(), when I
investigated the XMLRpc servers logs I don't see anything special all of the
threads there are in the ThreadPool awaiting more work. If someone would at
least give this some attention I could put together a sample application
that hits this issue.
Regards,
Rodney.
rodneygomes wrote:
>
> Hey Everyone,
>
> I recently started using xmlrpc for a testing framework that I'm
> developing
> and I found that as I pushed the amount of simultaneous requests on an
> XmlRpcclient up I could get the execute stuck somewhere in the IO land.
> Now I
> have a stack trace that shows for more than one instance where things are
> stuck:
>
> "DTFWorker-13" prio=10 tid=0x083c0000 nid=0x77d2 runnable
> [0xad030000..0xad030f30]
> java.lang.Thread.State: RUNNABLE
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
> - locked <0xae28b3c8> (a java.io.BufferedInputStream)
> at org.apache.xmlrpc.util.HttpUtil.readLine(HttpUtil.java:130)
> at
> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:209)
> at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:141)
> at
> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
> at
> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:75)
> at
> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
>
> and
>
> "DTFWorker-11" prio=10 tid=0x083b4400 nid=0x77d0 runnable
> [0xad0d2000..0xad0d3030]
> java.lang.Thread.State: RUNNABLE
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
> - locked <0xae25c180> (a java.io.BufferedInputStream)
> at org.apache.xmlrpc.util.HttpUtil.readLine(HttpUtil.java:130)
> at
> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:209)
> at
> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:141)
> at
> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
> at
> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:75)
> at
> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
>
> Now I've been able to work around this by setting a client side timeout of
> 3s
> and then retrying the operation upto 3 times. That is a workaround but its
> just masking the real bug.
>
> I'm running xmlrpc 3.1 and as you can see in the trace I am using the
> LiteHttp
> client. The server side is the WebServer class that is supplied with the
> xmlrpc library.
>
> let me know if there is anything else that would be helpful to figure out
> the
> issue here.
>
> Regards,
> Rodney.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Client-getting-stuck-in-IO-layer...-tp12206458p14747996.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Re: Client getting stuck in IO layer...
Posted by Jochen Wiedmann <jo...@gmail.com>.
On Jan 11, 2008 2:32 AM, rodneygomes <ro...@gmail.com> wrote:
> Not a single response in what half a year ? I still see this problem with
> the same client and it just keeps getting stuck on the socketRead0(), when I
> investigated the XMLRpc servers logs I don't see anything special all of the
> threads there are in the ThreadPool awaiting more work. If someone would at
> least give this some attention I could put together a sample application
> that hits this issue.
I'm not sure, but there may be a similar issue with the
LiteHttpTransportFactory that that what we had in the sun stuff. See
https://issues.apache.org/jira/browse/XMLRPC-150
Try switching to the sun transport, using the snapshot, which is
mentioned in the above bug report.
Jochen
--
Look, that's why there's rules, understand? So that you think before
you break 'em.
-- (Terry Pratchett, Thief of Time)
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Connection & Read timeout for XmlRpcSunHttpTransport
Posted by Gam <ga...@fastmail.fm>.
Dear all,
My concern is the confusion between the implementation of
XmlRpcSunHttpTransport using the java.net.HttpURLConnection and the
XmlRpcClientConfigImpl which rightfully specifies connection/read
timeouts.
The problem is that those are not forwarded to
java.net.HttpURLConnection which supports those properties since java
1.5. A lot of us use java 1.5 and know that it supports it,
therefore, we assume that it will just work. Unfortunately, it is not
the case and we need to debug, download the source to check to
realise it.
My proposition is to add the following in the class
XmlRpcSunHttpTransport:
public Object sendRequest(XmlRpcRequest pRequest) throws
XmlRpcException {
XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig)
pRequest.getConfig();
try {
conn = newURLConnection(config.getServerURL());
conn.setUseCaches(false);
conn.setDoInput(true);
conn.setDoOutput(true);
//PROPOSED MODIFICATION START
//here we should reliably & elegantly check if we are
running java 1.5
conn.setConnectTimeout(config.getConnectionTimeout());
conn.setReadTimeout(config.getReplyTimeout());
//PROPOSED MODIFICATION STOP
} catch (IOException e) {
throw new XmlRpcException("Failed to create URLConnection: " +
e.getMessage(), e);
}
return super.sendRequest(pRequest);
}
I didn't find a nice way of detecting if we have a higher version of
JRE instead of parsing java.version. Anyone knows?
Best Regards,
Gam.
PS: Little rant:
I still think that the Apache XML-RPC library as lost a bit of the
spirit of the xmlrpc protocol (its simplicity) with the release of v3.x.
I noticed that my request for a simple class (ObjectHandlerMapping)
to let us use object as handler didn't get much attention, but I'm
still trying :o)
Re: Client getting stuck in IO layer...
Posted by rodneygomes <ro...@gmail.com>.
I changed the server end to use Jetty instead of using the built-in
WebServer that comes with xmlrpc and havent' seen any of the requests
getting stuck. We'll keep you guys update as sometimes the bug didnt' show
itself for a while (very timing sensitive).
Thanks for fast responses...
Rodney.
rodneygomes wrote:
>
>
> Not a single response in what half a year ? I still see this problem with
> the same client and it just keeps getting stuck on the socketRead0(), when
> I investigated the XMLRpc servers logs I don't see anything special all of
> the threads there are in the ThreadPool awaiting more work. If someone
> would at least give this some attention I could put together a sample
> application that hits this issue.
>
> Regards,
> Rodney.
>
>
> rodneygomes wrote:
>>
>> Hey Everyone,
>>
>> I recently started using xmlrpc for a testing framework that I'm
>> developing
>> and I found that as I pushed the amount of simultaneous requests on an
>> XmlRpcclient up I could get the execute stuck somewhere in the IO land.
>> Now I
>> have a stack trace that shows for more than one instance where things are
>> stuck:
>>
>> "DTFWorker-13" prio=10 tid=0x083c0000 nid=0x77d2 runnable
>> [0xad030000..0xad030f30]
>> java.lang.Thread.State: RUNNABLE
>> at java.net.SocketInputStream.socketRead0(Native Method)
>> at java.net.SocketInputStream.read(SocketInputStream.java:129)
>> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
>> at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
>> - locked <0xae28b3c8> (a java.io.BufferedInputStream)
>> at org.apache.xmlrpc.util.HttpUtil.readLine(HttpUtil.java:130)
>> at
>> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:209)
>> at
>> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:141)
>> at
>> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
>> at
>> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:75)
>> at
>> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
>>
>> and
>>
>> "DTFWorker-11" prio=10 tid=0x083b4400 nid=0x77d0 runnable
>> [0xad0d2000..0xad0d3030]
>> java.lang.Thread.State: RUNNABLE
>> at java.net.SocketInputStream.socketRead0(Native Method)
>> at java.net.SocketInputStream.read(SocketInputStream.java:129)
>> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
>> at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
>> - locked <0xae25c180> (a java.io.BufferedInputStream)
>> at org.apache.xmlrpc.util.HttpUtil.readLine(HttpUtil.java:130)
>> at
>> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.getInputStream(XmlRpcLiteHttpTransport.java:209)
>> at
>> org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:141)
>> at
>> org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)
>> at
>> org.apache.xmlrpc.client.XmlRpcLiteHttpTransport.sendRequest(XmlRpcLiteHttpTransport.java:75)
>> at
>> org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
>>
>> Now I've been able to work around this by setting a client side timeout
>> of 3s
>> and then retrying the operation upto 3 times. That is a workaround but
>> its
>> just masking the real bug.
>>
>> I'm running xmlrpc 3.1 and as you can see in the trace I am using the
>> LiteHttp
>> client. The server side is the WebServer class that is supplied with the
>> xmlrpc library.
>>
>> let me know if there is anything else that would be helpful to figure out
>> the
>> issue here.
>>
>> Regards,
>> Rodney.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Client-getting-stuck-in-IO-layer...-tp12206458p14778408.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Re: Client getting stuck in IO layer...
Posted by rodneygomes <ro...@gmail.com>.
The only problem with setting reply timeouts is that for some of my remote
actions can take a few milliseconds but others can take 30s or more... so a
timeout of 30s doesn't make sense while if I set it too low the timeout will
actually cut off the operation that is taking its time to complete
operation. If there were a simple way of setting the read timeout on the
socket I think that may work if its just an issue with the java nio sockets
not returning some bytes.
Btw, I have seen an issue like this before when the person writing to the
socket doesn't flush at the end and doesn't close it either, what happens is
that nothing is going to make those bytes move down the pipe and the reader
can be stuck forever. I'm going to have a look at the receiving end and the
code that is there to see that appropriate flushing of the sockets are being
done.
Thank you for your response...
Rodney.
Brandon Chubb-2 wrote:
>
> On Thu, 10 Jan 2008, rodneygomes wrote:
>> Not a single response in what half a year ? I still see this problem with
>> the same client and it just keeps getting stuck on the socketRead0(),
>> when I
>> investigated the XMLRpc servers logs I don't see anything special all of
>> the
>> threads there are in the ThreadPool awaiting more work. If someone would
>> at
>> least give this some attention I could put together a sample application
>> that hits this issue.
>
> I'm not sure how load affects this, but there's always the possibility of
> the other side of the socket not cooperating, so I would use timeouts
> on the socket. I don't think the LiteHttp has any timeout support in
> 3.1, but it's easy enough to extend if you're determined to use that.
> I had to duplicate some classes, though, because they weren't public,
> and I wanted to make any extensions under our own source. We're still
> using V2.0, though.
>
> By V3.1, there is some timeout options, though -- scan the source for
> setConnectTimeout and setReadTimeout. The latter may be more appropriate
> for you problem, but i think the connect timeout actually covers more
> situations.
>
> Actually, now that I go grepping through the source:
>
> ./xmlrpc-3.1/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLiteHttpTranspo
> rt.java: if (config.getReplyTimeout() != 0)
> ./xmlrpc-3.1/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLiteHttpTranspo
> rt.java: socket.setSoTimeout(config.getReplyTimeout());
> ./xmlrpc-3.1/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConf
> ig.java: int getConnectionTimeout();
> ./xmlrpc-3.1/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConf
> ig.java: int getReplyTimeout();
>
> So it does look like some timeout support is in LiteHttp, you just need to
> use it.
>
> -bc
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Client-getting-stuck-in-IO-layer...-tp12206458p14778406.html
Sent from the Apache Xml-RPC - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org
Re: Client getting stuck in IO layer...
Posted by Brandon Chubb <bf...@excite.com>.
On Thu, 10 Jan 2008, rodneygomes wrote:
> Not a single response in what half a year ? I still see this problem with
> the same client and it just keeps getting stuck on the socketRead0(), when I
> investigated the XMLRpc servers logs I don't see anything special all of the
> threads there are in the ThreadPool awaiting more work. If someone would at
> least give this some attention I could put together a sample application
> that hits this issue.
I'm not sure how load affects this, but there's always the possibility of
the other side of the socket not cooperating, so I would use timeouts
on the socket. I don't think the LiteHttp has any timeout support in
3.1, but it's easy enough to extend if you're determined to use that.
I had to duplicate some classes, though, because they weren't public,
and I wanted to make any extensions under our own source. We're still
using V2.0, though.
By V3.1, there is some timeout options, though -- scan the source for
setConnectTimeout and setReadTimeout. The latter may be more appropriate
for you problem, but i think the connect timeout actually covers more
situations.
Actually, now that I go grepping through the source:
./xmlrpc-3.1/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLiteHttpTranspo
rt.java: if (config.getReplyTimeout() != 0)
./xmlrpc-3.1/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLiteHttpTranspo
rt.java: socket.setSoTimeout(config.getReplyTimeout());
./xmlrpc-3.1/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConf
ig.java: int getConnectionTimeout();
./xmlrpc-3.1/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConf
ig.java: int getReplyTimeout();
So it does look like some timeout support is in LiteHttp, you just need to
use it.
-bc
---------------------------------------------------------------------
To unsubscribe, e-mail: xmlrpc-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: xmlrpc-dev-help@ws.apache.org