Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Aug 2, 2022
1 parent 7792bee commit 43d3c04
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -44,6 +44,7 @@
import java.util.Enumeration;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Logger;

import static com.google.common.base.Preconditions.checkArgument;
Expand Down Expand Up @@ -273,6 +274,7 @@ private static final class GrpcReadListener implements ReadListener {
final AsyncContext asyncCtx;
final ServletInputStream input;
final InternalLogId logId;
private final AtomicBoolean closed = new AtomicBoolean(false);

GrpcReadListener(
ServletServerStream stream,
Expand Down Expand Up @@ -315,6 +317,10 @@ public void onDataAvailable() throws IOException {
@Override
public void onAllDataRead() {
logger.log(FINE, "[{0}] onAllDataRead", logId);
if (!closed.compareAndSet(false, true)) {
// https://github.com/eclipse/jetty.project/issues/8405
logger.log(FINE, "[{0}] onAllDataRead already called, skipping this one", logId);
}
stream.transportState().runOnTransportThread(
() -> stream.transportState().inboundDataReceived(ReadableBuffers.empty(), true));
}
Expand Down

0 comments on commit 43d3c04

Please sign in to comment.