Hi

We have just released XFire 1.2.6 as part of a new application, but are now seeing many errors. These errors never showed up during dev and testing, and seem to be related to concurrency levels in production traffic.

I'm now able to reproduce these errors reliably, and it seems to suggest that the initialization/startup of the XFire Client is not thread-safe. If I ensure that the initialization is single-threaded, after that it seems to be fine, i.e. it handles concurrent threads without error; but not if it's hammered by multiple threads at startup.

Below is an example of a SOAP message sent by the Client when it has been "corrupted" by multiple threads: as you can see it looks like it is literally interleaving multiple requests in one XML structure! I've deleted lots of detail and tried to format it a bit, but you can see multiple SOAP bodies, duplicated characters, etc.

The underlying HttpClient is set up correctly with the MultiThreadedHttpConnectionManager, so it seems like it is the XFire client that is at fault. I've tried various things, to no avail:
- disabling keep-alive
- disabling expect-continue
- adjusting HTTP connection pools
- using XmlBeans binding instead of Jaxb
- using the SOAP 1.1 port instead of 1.2
- etc.

I hope the answer is not going to be that the Client is inherently not thread-safe and that I have to use a new Client per request, or maintain my own pool of clients, etc.! That's like saying I have to manage my own JDBC connection pool!

Please help
Cornel


POST / HTTP/1.1
SOAPAction: "urn:shazam-com:internal:recognition:webservices:v1:performRecognitionAsyncIn"
Content-Type: application/soap+xml; charset=UTF-8
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)
Host: localhost:8660
Expect: 100-continue
Content-Length: 34172

<<soap:Envelopesoap:Envelope<<soap:Envelopesoap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"; ...>
<soap:Body xmlns:soap="http://www.w3.org/2003/05/soap-envelope";    ..>
<soap:Body xmlns:soap="http://www.w3.org/2003/05/soap-envelope";    ..>
<soap:Bodyxmlns:soap="http://www.w3.org/2003/05/soap-envelope";    ..>
<soap:Body xxmmllnnss::nnss11==""uurrnn::sshhaazzaamm--ccoomm::iinntteerrnnaall::rreeccooggnniittiioonn::mmeessssaaggeess::vv11""
   xmlns:ns1="urn:shazam-com:internal:recognition:messages:v1"
   xmlns:ns1="urn:shazam-com:internal:recognition:messages:v1">>

<<nnss11::PPeerrffoorrmmRReeccooggnniittiioonnAAssyynnccRReeqquueesstt>
<>n<s1:PerformRecnosg1n:iPteirofnoArsmyRneccRoegqnuietsitonAsyncRequest
xmln sx:mnlsn2s=:"ns2="urn:shauzranm:-schoamz:aimn-tceormn:ailn:treercnoagln:irteicoong:noibtjieocnt:so:bvj1ec"ts:v1"



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to