You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2017/08/23 16:49:58 UTC

HC Core4 real vs. manufactured timeouts in org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)

Hi All:

In HC Core4, I have a use case where the method
org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)
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.

Thoughts?

Gary

Re: HC Core4 real vs. manufactured timeouts in org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2017-08-23 at 15:32 -0600, Gary Gregory wrote:
> 

...

> 
> That's what I needed to know!
> 
> Any thoughts on when to push HcCore 4.4.7?
> 
> Thank you,
> Gary
> 

Immediately after 5.0-alpha4, I hope.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: HC Core4 real vs. manufactured timeouts in org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Aug 23, 2017 at 3:26 PM, Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2017-08-23 at 10:49 -0600, Gary Gregory wrote:
> > Hi All:
> >
> > In HC Core4, I have a use case where the method
> > org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConn
> > ection)
> > 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.
> >
> > Thoughts?
> >
> > Gary
>
> Gary
>
> All SocketTimeoutException thrown by non-blocking i/o classes are
> manufactured. What you call 'real' timeouts can only be thrown by JRE
> blocking i/o code. I personally see no good reason to
> distinguish SocketTimeoutException thrown by JRE code and those thrown
> by i/o reactors. They can never get mixed up.
>

That's what I needed to know!

Any thoughts on when to push HcCore 4.4.7?

Thank you,
Gary


>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: HC Core4 real vs. manufactured timeouts in org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConnection)

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2017-08-23 at 10:49 -0600, Gary Gregory wrote:
> Hi All:
> 
> In HC Core4, I have a use case where the method
> org.apache.http.nio.protocol.HttpAsyncService.timeout(NHttpServerConn
> ection)
> 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.
> 
> Thoughts?
> 
> Gary

Gary

All SocketTimeoutException thrown by non-blocking i/o classes are
manufactured. What you call 'real' timeouts can only be thrown by JRE
blocking i/o code. I personally see no good reason to
distinguish SocketTimeoutException thrown by JRE code and those thrown
by i/o reactors. They can never get mixed up.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org