This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.4.x-fixes by this push:
new ec29d3d CXF-8617: The
org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduitTest hangs
intermittently (#875)
ec29d3d is described below
commit ec29d3d6ef405f89ac3452accb8a05a120f070a3
Author: Andriy Redko <[email protected]>
AuthorDate: Sun Nov 14 17:18:01 2021 -0500
CXF-8617: The
org.apache.cxf.transport.http.asyncclient.hc5.AsyncHTTPConduitTest hangs
intermittently (#875)
(cherry picked from commit 6486b53b8838fbb0a84688461585c1a5768f05ce)
---
.../cxf/transport/http/asyncclient/hc5/SharedOutputBuffer.java | 3 +--
.../cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitTest.java | 6 +++++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git
a/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/SharedOutputBuffer.java
b/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/SharedOutputBuffer.java
index 42ddc13..b0b9ed2 100644
---
a/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/SharedOutputBuffer.java
+++
b/rt/transports/http-hc5/src/main/java/org/apache/cxf/transport/http/asyncclient/hc5/SharedOutputBuffer.java
@@ -119,10 +119,9 @@ public class SharedOutputBuffer extends ExpandableBuffer {
bytesWritten = channel.write(buffer());
}
}
- if ((largeWrapper == null || !largeWrapper.hasRemaining()) &&
!super.hasData()) {
+ if ((largeWrapper == null || !largeWrapper.hasRemaining()) &&
!super.hasData() && this.endOfStream) {
// No more buffered content
// If at the end of the stream, terminate
- this.endOfStream = true;
channel.endStream();
}
// no need to signal if the large wrapper is present and has data
remaining
diff --git
a/rt/transports/http-hc5/src/test/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitTest.java
b/rt/transports/http-hc5/src/test/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitTest.java
index b072c56..42ecaf4 100644
---
a/rt/transports/http-hc5/src/test/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitTest.java
+++
b/rt/transports/http-hc5/src/test/java/org/apache/cxf/transport/http/asyncclient/hc5/AsyncHTTPConduitTest.java
@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import javax.xml.ws.AsyncHandler;
@@ -320,7 +321,10 @@ public class AsyncHTTPConduitTest extends
AbstractBusClientServerTestBase {
} else {
Thread.sleep(50);
}
- initialThreadsLatch.await();
+ if (!initialThreadsLatch.await(30, TimeUnit.SECONDS)) {
+ throw new TimeoutException("The initial threads latch
timeout exceeded,"
+ + " exception in JaxwsClientCallback?");
+ }
doneLatch.countDown();
} catch (Exception e) {
throw new RuntimeException(e);