Skip to content

Commit

Permalink
Temp: investigating failures
Browse files Browse the repository at this point in the history
  • Loading branch information
fl4via committed Oct 16, 2023
1 parent 6f0ca47 commit d6d4394
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ protected AbstractHttp2StreamSourceChannel createChannelImpl(FrameHeaderData fra
}
case FRAME_TYPE_GOAWAY: {
Http2GoAwayParser http2GoAwayParser = (Http2GoAwayParser) frameParser.parser;
System.out.println(this + " received go away with status " + http2GoAwayParser);
channel = new Http2GoAwayStreamSourceChannel(this, frameData, frameParser.getFrameLength(), http2GoAwayParser.getStatusCode(), http2GoAwayParser.getLastGoodStreamId());
peerGoneAway = true;
//the peer is going away
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public boolean handle(final ByteBuffer byteBuffer) throws IOException {
if(continuationParser != null && type != FRAME_TYPE_CONTINUATION) {
throw new ConnectionErrorException(Http2Channel.ERROR_PROTOCOL_ERROR, UndertowMessages.MESSAGES.expectedContinuationFrame());
}
//System.out.println(http2Channel + " parsing frame with stream id: " + streamId);
switch (type) {
case FRAME_TYPE_DATA: {
if (streamId == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ protected Http2GoAwayStreamSinkChannel(Http2Channel channel, int status, int las
super(channel);
this.status = status;
this.lastGoodStreamId = lastGoodStreamId;
new Exception("creating go away with status " + status).printStackTrace();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ public void handleEvent(AbstractFramedChannel channel) {
try {
AbstractFramedStreamSourceChannel stream = channel.receive();
if(stream != null) {
System.out.println("AbstractFramedChannel.DRAIN_LISTENER invoked");
UndertowLogger.REQUEST_IO_LOGGER.debugf("Draining channel %s as no receive listener has been set", stream);
stream.getReadSetter().set(ChannelListeners.drainListener(Long.MAX_VALUE, null, null));
stream.wakeupReads();
Expand Down Expand Up @@ -968,6 +969,7 @@ public void handleEvent(final StreamSourceChannel channel) {
} else {
ChannelListener listener = receiveSetter.get();
if (listener == null) {
System.out.println("Setting DRAIN LISTENER from inside FrameReadListener");
listener = DRAIN_LISTENER;
}
//UndertowLogger.REQUEST_IO_LOGGER.tracef("Invoking receive listener: %s - receiver: %s", listener, receiver);
Expand Down Expand Up @@ -1023,6 +1025,7 @@ public void handleEvent(final CloseableChannel c) {
if(!sourceClosed || !sinkClosed) {
return; //both sides need to be closed
} else if(localReadData != null && !localReadData.isFreed()) {
System.out.println("handling event closable channel, and local read data was not null, nor was it free, we'll enable drain listener");
//we make sure there is no data left to receive, if there is then we invoke the receive listener
runInIoThread(new Runnable() {
@Override
Expand All @@ -1031,6 +1034,7 @@ public void run() {
int rem = localReadData.getBuffer().remaining();
ChannelListener listener = receiveSetter.get();
if(listener == null) {
System.out.println("set listener to drain listener");
listener = DRAIN_LISTENER;
}
ChannelListeners.invokeChannelListener(AbstractFramedChannel.this, listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public void testNoErrorWithOverwrittenConfig() throws Exception {
}

public void assertDoSRstFramesHandled(int totalNumberOfRequests, int rstStreamLimit, boolean errorExpected, URI serverAddress) throws Exception {
Thread.sleep(10000);
final List<ClientResponse> responses = new CopyOnWriteArrayList<>();
final CountDownLatch latch = new CountDownLatch(totalNumberOfRequests);

Expand Down

0 comments on commit d6d4394

Please sign in to comment.