[ https://issues.apache.org/jira/browse/OLINGO-1591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
varun_ramesh updated OLINGO-1591: --------------------------------- Description: When OData V4 batch request payload is more than 4MB, the payload parsing gets stuck in deadlock. Both PipedOutputStream and PipedInputStream goes into lock there waiting indefinitely. *Thread 1* wait:-1, Object (java.lang) wait:328, Object (java.lang) write:138, PipedOutputStream (org.apache.olingo.client.core.communication.util) write:175, PipedOutputStream (org.apache.olingo.client.core.communication.util) write:175, PipedOutputStream (org.apache.olingo.client.core.communication.util) write:115, PipedOutputStream (org.apache.olingo.client.core.communication.util) rawAppend:57, ODataBatchRequestImpl (org.apache.olingo.client.core.communication.request.batch) batch:114, AbstractODataBasicRequest (org.apache.olingo.client.core.communication.request) addRequest:130, ODataChangesetImpl (org.apache.olingo.client.core.communication.request.batch) changesetBatchRequest:533, BatchClientITCase (org.apache.olingo.fit.tecsvc.client) invoke0:-1, NativeMethodAccessorImpl (jdk.internal.reflect) invoke:62, NativeMethodAccessorImpl (jdk.internal.reflect) invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect) invoke:566, Method (java.lang.reflect) runReflectiveCall:59, FrameworkMethod$1 (org.junit.runners.model) run:12, ReflectiveCallable (org.junit.internal.runners.model) invokeExplosively:56, FrameworkMethod (org.junit.runners.model) evaluate:17, InvokeMethod (org.junit.internal.runners.statements) evaluate:26, RunBefores (org.junit.internal.runners.statements) evaluate:306, ParentRunner$3 (org.junit.runners) evaluate:100, BlockJUnit4ClassRunner$1 (org.junit.runners) runLeaf:366, ParentRunner (org.junit.runners) runChild:103, BlockJUnit4ClassRunner (org.junit.runners) runChild:63, BlockJUnit4ClassRunner (org.junit.runners) run:331, ParentRunner$4 (org.junit.runners) schedule:79, ParentRunner$1 (org.junit.runners) runChildren:329, ParentRunner (org.junit.runners) access$100:66, ParentRunner (org.junit.runners) evaluate:293, ParentRunner$2 (org.junit.runners) run:413, ParentRunner (org.junit.runners) runChild:128, Suite (org.junit.runners) runChild:27, Suite (org.junit.runners) run:331, ParentRunner$4 (org.junit.runners) schedule:79, ParentRunner$1 (org.junit.runners) runChildren:329, ParentRunner (org.junit.runners) access$100:66, ParentRunner (org.junit.runners) evaluate:293, ParentRunner$2 (org.junit.runners) evaluate:26, RunBefores (org.junit.internal.runners.statements) evaluate:27, RunAfters (org.junit.internal.runners.statements) evaluate:306, ParentRunner$3 (org.junit.runners) run:413, ParentRunner (org.junit.runners) run:137, JUnitCore (org.junit.runner) startRunnerWithArgs:69, JUnit4IdeaTestRunner (com.intellij.junit4) execute:38, IdeaTestRunner$Repeater$1 (com.intellij.rt.junit) repeat:11, TestsRepeater (com.intellij.rt.execution.junit) startRunnerWithArgs:35, IdeaTestRunner$Repeater (com.intellij.rt.junit) prepareStreamsAndStart:235, JUnitStarter (com.intellij.rt.junit) main:54, JUnitStarter (com.intellij.rt.junit) *Thread 2* wait:-1, Object (java.lang) wait:328, Object (java.lang) read:170, PipedInputStream (org.apache.olingo.client.core.communication.util) read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) read:149, PipedInputStream (org.apache.olingo.client.core.communication.util) writeTo:133, InputStreamEntity (org.apache.http.entity) writeTo:96, HttpEntityWrapper (org.apache.http.entity) writeTo:110, EntityEnclosingRequestWrapper$EntityWrapper (org.apache.http.impl.client) serialize:118, EntitySerializer (org.apache.http.impl.entity) sendRequestEntity:274, AbstractHttpClientConnection (org.apache.http.impl) sendRequestEntity:214, ManagedClientConnectionImpl (org.apache.http.impl.conn) doSendRequest:238, HttpRequestExecutor (org.apache.http.protocol) execute:123, HttpRequestExecutor (org.apache.http.protocol) tryExecute:679, DefaultRequestDirector (org.apache.http.impl.client) execute:481, DefaultRequestDirector (org.apache.http.impl.client) doExecute:835, AbstractHttpClient (org.apache.http.impl.client) execute:83, CloseableHttpClient (org.apache.http.impl.client) execute:108, CloseableHttpClient (org.apache.http.impl.client) execute:56, CloseableHttpClient (org.apache.http.impl.client) doExecute:307, AbstractODataRequest (org.apache.olingo.client.core.communication.request) doExecute:73, ODataBatchRequestImpl (org.apache.olingo.client.core.communication.request.batch) access$300:51, AbstractODataStreamedRequest (org.apache.olingo.client.core.communication.request.streamed) call:123, AbstractODataStreamedRequest$2 (org.apache.olingo.client.core.communication.request.streamed) call:119, AbstractODataStreamedRequest$2 (org.apache.olingo.client.core.communication.request.streamed) run$$$capture:264, FutureTask (java.util.concurrent) run:-1, FutureTask (java.util.concurrent) runWorker:1128, ThreadPoolExecutor (java.util.concurrent) run:628, ThreadPoolExecutor$Worker (java.util.concurrent) run:829, Thread (java.lang) The buffer which is used as a circular buffer has a size of 4MB initialised in PipedInputStream. Whenever the batch request payload is greater than 4MB, both the main thread & future task goes into deadlock. was:When OData V4 batch request payload is more than 4MB, the payload parsing gets stuck in deadlock. > Batch processing stuck in deadlock when payload size is greater than 4MB > ------------------------------------------------------------------------ > > Key: OLINGO-1591 > URL: https://issues.apache.org/jira/browse/OLINGO-1591 > Project: Olingo > Issue Type: Bug > Components: odata4-client > Reporter: varun_ramesh > Priority: Major > > When OData V4 batch request payload is more than 4MB, the payload parsing > gets stuck in deadlock. Both PipedOutputStream and PipedInputStream goes into > lock there waiting indefinitely. > *Thread 1* > wait:-1, Object (java.lang) > wait:328, Object (java.lang) > write:138, PipedOutputStream > (org.apache.olingo.client.core.communication.util) > write:175, PipedOutputStream > (org.apache.olingo.client.core.communication.util) > write:175, PipedOutputStream > (org.apache.olingo.client.core.communication.util) > write:115, PipedOutputStream > (org.apache.olingo.client.core.communication.util) > rawAppend:57, ODataBatchRequestImpl > (org.apache.olingo.client.core.communication.request.batch) > batch:114, AbstractODataBasicRequest > (org.apache.olingo.client.core.communication.request) > addRequest:130, ODataChangesetImpl > (org.apache.olingo.client.core.communication.request.batch) > changesetBatchRequest:533, BatchClientITCase > (org.apache.olingo.fit.tecsvc.client) > invoke0:-1, NativeMethodAccessorImpl (jdk.internal.reflect) > invoke:62, NativeMethodAccessorImpl (jdk.internal.reflect) > invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect) > invoke:566, Method (java.lang.reflect) > runReflectiveCall:59, FrameworkMethod$1 (org.junit.runners.model) > run:12, ReflectiveCallable (org.junit.internal.runners.model) > invokeExplosively:56, FrameworkMethod (org.junit.runners.model) > evaluate:17, InvokeMethod (org.junit.internal.runners.statements) > evaluate:26, RunBefores (org.junit.internal.runners.statements) > evaluate:306, ParentRunner$3 (org.junit.runners) > evaluate:100, BlockJUnit4ClassRunner$1 (org.junit.runners) > runLeaf:366, ParentRunner (org.junit.runners) > runChild:103, BlockJUnit4ClassRunner (org.junit.runners) > runChild:63, BlockJUnit4ClassRunner (org.junit.runners) > run:331, ParentRunner$4 (org.junit.runners) > schedule:79, ParentRunner$1 (org.junit.runners) > runChildren:329, ParentRunner (org.junit.runners) > access$100:66, ParentRunner (org.junit.runners) > evaluate:293, ParentRunner$2 (org.junit.runners) > run:413, ParentRunner (org.junit.runners) > runChild:128, Suite (org.junit.runners) > runChild:27, Suite (org.junit.runners) > run:331, ParentRunner$4 (org.junit.runners) > schedule:79, ParentRunner$1 (org.junit.runners) > runChildren:329, ParentRunner (org.junit.runners) > access$100:66, ParentRunner (org.junit.runners) > evaluate:293, ParentRunner$2 (org.junit.runners) > evaluate:26, RunBefores (org.junit.internal.runners.statements) > evaluate:27, RunAfters (org.junit.internal.runners.statements) > evaluate:306, ParentRunner$3 (org.junit.runners) > run:413, ParentRunner (org.junit.runners) > run:137, JUnitCore (org.junit.runner) > startRunnerWithArgs:69, JUnit4IdeaTestRunner (com.intellij.junit4) > execute:38, IdeaTestRunner$Repeater$1 (com.intellij.rt.junit) > repeat:11, TestsRepeater (com.intellij.rt.execution.junit) > startRunnerWithArgs:35, IdeaTestRunner$Repeater (com.intellij.rt.junit) > prepareStreamsAndStart:235, JUnitStarter (com.intellij.rt.junit) > main:54, JUnitStarter (com.intellij.rt.junit) > > *Thread 2* > wait:-1, Object (java.lang) > wait:328, Object (java.lang) > read:170, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:177, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:208, PipedInputStream (org.apache.olingo.client.core.communication.util) > read:149, PipedInputStream (org.apache.olingo.client.core.communication.util) > writeTo:133, InputStreamEntity (org.apache.http.entity) > writeTo:96, HttpEntityWrapper (org.apache.http.entity) > writeTo:110, EntityEnclosingRequestWrapper$EntityWrapper > (org.apache.http.impl.client) > serialize:118, EntitySerializer (org.apache.http.impl.entity) > sendRequestEntity:274, AbstractHttpClientConnection (org.apache.http.impl) > sendRequestEntity:214, ManagedClientConnectionImpl (org.apache.http.impl.conn) > doSendRequest:238, HttpRequestExecutor (org.apache.http.protocol) > execute:123, HttpRequestExecutor (org.apache.http.protocol) > tryExecute:679, DefaultRequestDirector (org.apache.http.impl.client) > execute:481, DefaultRequestDirector (org.apache.http.impl.client) > doExecute:835, AbstractHttpClient (org.apache.http.impl.client) > execute:83, CloseableHttpClient (org.apache.http.impl.client) > execute:108, CloseableHttpClient (org.apache.http.impl.client) > execute:56, CloseableHttpClient (org.apache.http.impl.client) > doExecute:307, AbstractODataRequest > (org.apache.olingo.client.core.communication.request) > doExecute:73, ODataBatchRequestImpl > (org.apache.olingo.client.core.communication.request.batch) > access$300:51, AbstractODataStreamedRequest > (org.apache.olingo.client.core.communication.request.streamed) > call:123, AbstractODataStreamedRequest$2 > (org.apache.olingo.client.core.communication.request.streamed) > call:119, AbstractODataStreamedRequest$2 > (org.apache.olingo.client.core.communication.request.streamed) > run$$$capture:264, FutureTask (java.util.concurrent) > run:-1, FutureTask (java.util.concurrent) > runWorker:1128, ThreadPoolExecutor (java.util.concurrent) > run:628, ThreadPoolExecutor$Worker (java.util.concurrent) > run:829, Thread (java.lang) > > The buffer which is used as a circular buffer has a size of 4MB initialised > in PipedInputStream. Whenever the batch request payload is greater than 4MB, > both the main thread & future task goes into deadlock. -- This message was sent by Atlassian Jira (v8.20.10#820010)