ok2c commented on code in PR #606:
URL:
https://github.com/apache/httpcomponents-core/pull/606#discussion_r2787950725
##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/AbstractH2StreamMultiplexer.java:
##########
Review Comment:
@arturobernalg It has to be massively simpler
In `AbstractH2StreamMultiplexer` at the line 522 do the following
```
if (hasBeenIdleTooLong && ioSession.hasCommands() && pingHandlers.isEmpty())
{
ioSession.setSocketTimeout(Timeout.ofSeconds(5));
executePing(new PingCommand(new BasicPingHandler(new Callback<Boolean>()
{
@Override
public void execute(final Boolean result) {
// restore timeout
ioSession.setSocketTimeout(...);
if (result) {
// proceed with command execution
requestSessionOutput();
} else {
ioSession.enqueue(new ShutdownCommand(CloseMode.GRACEFUL),
Command.Priority.NORMAL);
}
}
})));
return;
}
```
Add idle time tracking, and that _should_ be all it takes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]