Skip to content

Commit 8856a15

Browse files
tomas-langertvallin
authored andcommitted
Releasing entity count down latch even if connection is set to close. (helidon-io#8376)
1 parent c131bde commit 8856a15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

webserver/webserver/src/main/java/io/helidon/webserver/http1/Http1Connection.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ private void route(HttpPrologue prologue, WritableHeaders<?> headers) {
420420

421421
routing.route(ctx, request, response);
422422

423-
consumeEntity(request, response);
423+
consumeEntity(request, response, entityReadLatch);
424424
try {
425425
entityReadLatch.await();
426426
} catch (InterruptedException e) {
@@ -433,9 +433,10 @@ private void route(HttpPrologue prologue, WritableHeaders<?> headers) {
433433
}
434434
}
435435

436-
private void consumeEntity(Http1ServerRequest request, Http1ServerResponse response) {
436+
private void consumeEntity(Http1ServerRequest request, Http1ServerResponse response, CountDownLatch entityReadLatch) {
437437
if (response.headers().contains(HeaderValues.CONNECTION_CLOSE) || request.content().consumed()) {
438438
// we do not care about request entity if connection is getting closed
439+
entityReadLatch.countDown();
439440
return;
440441
}
441442
// consume the entity if not consumed by routing

0 commit comments

Comments
 (0)