hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject HC Core4 real vs. manufactured timeouts in org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)
Date Wed, 23 Aug 2017 16:49:58 GMT
Hi All:

In HC Core4, I have a use case where the method
is called when HC Core detects that a session has not been used in a while
(the timeout value).

In HttpAsyncService.timeout(NHttpServerConnection), we then create a
SocketTimeoutException and pass it on.

This has created some confusion further on down the processing when the
log(Exception) method is called and
my org.apache.http.ExceptionLogger.log(Exception) ends up being called.

How can I tell the difference between a real timeout and one of these
manufactured timeouts.

I wonder if we should create our own subclass of SocketTimeoutException
called SessionTimeoutException and use that
HttpAsyncService.timeout(NHttpServerConnection) instead of
SocketTimeoutException. This would make it backward compatible for
implementations that do instanceof SocketTimeoutException checks.

This would let my logging log SocketTimeoutException as ERRORs and
SessionTimeoutException as DEBUG.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message