Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5078

WSDLGetInterceptor holds a lock for too long

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      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.

      Attachments

        1. my.patch
          6 kB
          John Bellassai

        Issue Links

          Activity

            People

              dkulp Daniel Kulp
              jbellassai John Bellassai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: