Skip to content

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
voidmain committed Aug 29, 2023
1 parent 5425c9c commit eb345da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/io/fusionauth/http/server/HTTPServerThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,17 @@ private void cleanup() {
}

var processor = (HTTPProcessor) key.attachment();
boolean badChannel =
(processor.state() == ProcessorState.Read && processor.readThroughput() < minimumReadThroughput) || // Not reading fast enough
(processor.state() == ProcessorState.Write && processor.writeThroughput() < minimumWriteThroughput) || // Not writing fast enough
(processor.lastUsed() < now - clientTimeout.toMillis()); // Timed out
boolean readingSlow = processor.state() == ProcessorState.Read && processor.readThroughput() < minimumReadThroughput;
boolean writingSlow = processor.state() == ProcessorState.Write && processor.writeThroughput() < minimumWriteThroughput;
boolean timedOut = processor.lastUsed() < now - clientTimeout.toMillis();
boolean badChannel = readingSlow || writingSlow || timedOut;

if (!badChannel) {
continue;
}

logger.info("Closing connection readingslow=[{}] writingslow=[{}] timedout=[{}]", readingSlow, writingSlow, timedOut);

if (logger.isDebugEnabled()) {
var client = (SocketChannel) key.channel();
try {
Expand Down

0 comments on commit eb345da

Please sign in to comment.