1. Axis2
  2. AXIS2-4819

Race condition in WSDLDataLocator


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.5.4, 1.6.0
    • Component/s: wsdl
    • Labels:


      Observable behaviour:

      Sometimes WSDL request returns wrong WSDL. This occurs when multiple WSDL requests are made at the same time.

      The cause:

      org.apache.axis2.dataretrieval.WSDLDataLocator is created only once and reused in a multiple requests (see DataLocatorFactory, static method createDataLocator. The problem is that DataLocator contains a state that is changed during the request, most importantly the field "theService". It is possible that two concurrent WSDL request are processed at the same time and one request overrides theService field set by other request. Consider the following scenario:

      1. Both requests arrive (at the same time) at the line 129 (I assume version 1.4.1), which read:
      axisService2WOM = new AxisService2WSDL11(theService);
      2. Both requests start executing the line (reading theService field).
      3. Since WSDLDataLocator is shared between those two requests and theService is field of that class, both requests will use same AxisService to generate WSDL. As a result, both requests will output the same WSDL, which is obviously wrong.

      I don't understand, why theService is made field after all? I think, it should be a local variable instead.

        Issue Links


          Ivan Dubrov created issue -
          Andreas Veithen made changes -
          Field Original Value New Value
          Link This issue supercedes AXIS2-4437 [ AXIS2-4437 ]
          Andreas Veithen made changes -
          Fix Version/s 1.5.4 [ 12315568 ]
          Andreas Veithen made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Andreas Veithen [ veithen ]
          Fix Version/s 1.6 [ 12313622 ]
          Resolution Fixed [ 1 ]


            • Assignee:
              Andreas Veithen
              Ivan Dubrov
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: