A race condition between Axis2HttpRequest and ClientHandler nhttp transport
classes causes unreliable message delivery
----------------------------------------------------------------------------------------------------------------------
Key: SYNAPSE-540
URL: https://issues.apache.org/jira/browse/SYNAPSE-540
Project: Synapse
Issue Type: Bug
Components: Transports
Affects Versions: 1.2, NIGHTLY
Environment: Seen on: Windows XP, Windows Vista, Sun Java 5 update 18,
Sun Java 6 update 13, .NET framework 3.5, Tomcat 6.0.18
Reporter: Jarosław Bałut
Environment
1. Service "Version" from the axis2.war taken from the 1.4.1 release deployed
in Tomcat 6.0.18.
2. Proxy service configured in the Synapse 1.2 release.
3. Client implemented using .NET 3.5 WCF.
Symptoms
>From time to time the client invoking a method of the "Version" service hangs
>until the timeout occurs.
Analysis
When a request arriving at the proxy service in Synapse is transmitted over the
nhttp transport a race condition occurs between a thread executing the
Axis2HttpRequest.streamMessageContents method and a thread executing the
ClientHandler.responseReceived method. After HTTP headers are transmitted to
Tomcat the server replies with the "100 Continue" message. This response is
handled by the ClientHandler.responseReceived method, which (regardless of the
status code) sets the "completed" flag of the handled request to "true". If
this happens before the Axis2HttpRequest.streamMessageContents method in the
sending thread
actually sends the request, the server never gets it. It waits until a timeout
occurs and sends the "500 Internal Server Error" message. This causes the proxy
in Synapse to wait until the keep-alive connection is closed and reply with a
fault.
I provide the .NET based client for testing purposes (calling the proxy service
from an Axis2 based client causes the problem to appear much less frequently).
I attach the trace log from Synapse 1.2 (built from the 662321 revision of the
ClientHandler.java) and from WSO2 ESB 2.0.2 (which is based on a build of
Synapse including the slightly modified 708800 revision of the
ClientHandler.java).
I also suggest patches for the 662321 revision and for the so far latest
revision in the trunk - 761507.
This problem applies to the 1.2 release and to the trunk version.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]