Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1468

Batch Requests Block Indefinitely on Batch Request payloadManager() access when chunking disabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • (Java) V4 4.7.1
    • None
    • odata4-client
    • None

    Description

      When using the OData v4 Client to perform Batch requests with chunked transfer encoding disabled, obtaining the payloadManager() BatchManager causes a block that waits the thread indefinitely on a PipedInputStream.

      ODataClient client = ...
      client.getOdataClient().getConfiguration().setUseChuncked( false );
      ODataBatchRequest br = client.getBatchRequestFactory().getBatchRequest( <baseUrl> );
      
      //Thread waits indefinitely here, and the BatchManager is required to addRequest to the Batch
      BatchManager bm = br.payloadManager();
      

      The code locks on this IOUtils call because the input argument is a PipedInputStream:

      https://github.com/apache/olingo-odata4/blob/4.7.1-RC01/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java#L289

      called from by:

      https://github.com/apache/olingo-odata4/blob/4.7.1-RC01/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/AbstractODataStreamedRequest.java#L117

      I believe the problem could be fixed if chunking disabled would cause the URIUtils.shouldUseRepeatableHttpBodyEntry function to return true, thus the IOUtils.copy would not be executed until the Future of AbstractODataStreamedRequest is satisfied.

      https://github.com/apache/olingo-odata4/blob/4.7.1-RC01/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java#L267

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jon_apache Jonathan Jarvis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: