You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "John Bellassai (JIRA)" <ji...@apache.org> on 2013/06/13 22:51:20 UTC

[jira] [Created] (CXF-5078) WSDLGetInterceptor holds a lock for too long

John Bellassai created CXF-5078:
-----------------------------------

             Summary: WSDLGetInterceptor holds a lock for too long
                 Key: CXF-5078
                 URL: https://issues.apache.org/jira/browse/CXF-5078
             Project: CXF
          Issue Type: Bug
          Components: Simple Frontend
    Affects Versions: 2.7.5, 2.6.8, 2.5.10
            Reporter: John Bellassai
             Fix For: 2.5.11, 2.6.9, 2.7.6


WSDLGetInterceptor both creates the WSDL Document object and writes that data to the OutputStream while holding onto a lock.  This can cause major issues in an environment where that data is being sent to very slow clients or there are other general networking issues.

We have seen this problem manifest multiple times in a production environment where all of Tomcat's connection handler threads pile up while waiting for this lock to become available because it is being held by a thread which is trying to write to a socket but cannot for whatever reason.  Eventually Tomcat stops responding to new requests and must be bounced.

Daniel Kulp suggested that instead of writing the WSDL Document directly to the OutputStream from the message, rather write it to a CachedOutputStream while holding the lock. Then outside of the synchronized block, copy it from the CachedOutputStream to the real OutputStream to the client.  In this way, a single bad connection or slow client cannot cause trouble for others.

I will attach a patch made against the lastest WSDLGetInterceptor from 2.7.6-SNAPSHOT.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira