You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "CXF Developer (JIRA)" <ji...@apache.org> on 2013/10/28 13:32:31 UTC

[jira] [Comment Edited] (CXF-4524) Large request causes socket timeout on subsequent requests on WebLogic hosted service

    [ https://issues.apache.org/jira/browse/CXF-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806717#comment-13806717 ] 

CXF Developer edited comment on CXF-4524 at 10/28/13 12:31 PM:
---------------------------------------------------------------

This issue is very much reproducible in all versions of CXF.  The server side technologies are irrelevant as far as this issue is concerned. My case is as follows:

1) I have a web-application deployed on tomcat. In this web-application, I am consuming 2 web-services. These 2 web-services are invoked sequentially without any delay.
2) Important thing to note is that the endpoint URL of both these web-services have same host-name(IP) and same port number. Rest of the URL is different. (Both the URLs are plain HTTP. There is NO HTTPS)
3) First web-service is invoked. CXF processes and returns the response and starts a new thread for clean-up tasks. Lets call this new thread as 'Clean-up Thread'. In this clean-up thread, the socket (which was created while invoking this first web-service) is closed. However, since this clean-up thread is started after the response is returned to my web-application code, the 2nd webservice call and the 'clean-up thread(cleaning up sockets created for 1st web-service)' execute simultaneously. And by the time, the actual "java.net.Socket.close()" method is called in the 'cleanup thread', the 2nd web-service invocation is already started using the SAME socket object.

Now, at this point, the clean-up thread closes the socket (which was created while invoking the first web-service). And since, the second web-service invocation is using the same socket object, the invocation of 2nd web-service terminates abruptly and the following exception is thrown:
: java.net.SocketException: Unexpected end of file from server
                at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:777)
                at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
                at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1542)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1499)
                at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:395)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)


I hope you will be able to reproduce and fix the issue now.

[~pimlottc], [~metatech], FYI


was (Author: user_apache_jira):
This issue is very much reproducible in all versions of CXF.  The server side technologies are irrelevant as far as this issue is concerned. My case is as follows:

1) I have a web-application deployed on tomcat. In this web-application, I am consuming 2 web-services. These 2 web-services are invoked sequentially without any delay.
2) Important thing to note is that the endpoint URL of both these web-services have same host-name(IP) and same port number. Rest of the URL is different.
3) First web-service is invoked. CXF processes and returns the response and starts a new thread for clean-up tasks. Lets call this new thread as 'Clean-up Thread'. In this clean-up thread, the socket (which was created while invoking this first web-service) is closed. However, since this clean-up thread is started after the response is returned to my web-application code, the 2nd webservice call and the 'clean-up thread(cleaning up sockets for 1st web-service)' execute simultaneously. And by the time, the actual "java.net.Socket.close()" method is called in the 'cleanup thread', the 2nd web-service invocation is already started using the SAME socket object.

Now, at this point, the clean-up thread closes the socket (which was created while invoking this first web-service). And since, the second web-service invocation is using the same socket object, the invocation of 2nd web-service terminates abruptly and the following exception is thrown:
: java.net.SocketException: Unexpected end of file from server
                at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:777)
                at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
                at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
                at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1542)
                at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1499)
                at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:395)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)


I hope you will be able to reproduce and fix the issue now.

[~pimlottc], [~metatech], FYI

> Large request causes socket timeout on subsequent requests on WebLogic hosted service
> -------------------------------------------------------------------------------------
>
>                 Key: CXF-4524
>                 URL: https://issues.apache.org/jira/browse/CXF-4524
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.6.2
>         Environment: WebLogic 10.3.0.0
>            Reporter: Chris Pimlott
>         Attachments: stacktrace.client.txt, stacktrace.weblogic.txt, weblogic-socketTimeoutBug.zip
>
>
> I discovered an odd bug that appears to be some sort of interaction between CXF, WebLogic and HTTP keepalives.  I have a simple service in a webapp hosted in WebLogic 10.3.0.0.  I am hitting that service with a client stub generated from WSDL by cxf-codegen-plugin.
> The steps are as follows:
> 1. Create a new client service object
> 2. Make a first call, passing a fairly large (1000) list of strings
> 3. Make a second call to any method
> The first call executes properly, but the second call fails with a socket timeout.
> If the first call has a smaller or empty list of strings, the issue does not occur.
> If you add a delay of approx. 5 seconds between the two calls, the issue does not occur.  Shorter delays don't seem to be sufficient.
> If you disable HTTP keepalives, either on the client (via System property) or on the server, the issue does not occur.



--
This message was sent by Atlassian JIRA
(v6.1#6144)