hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Exceptions getting silently eaten away
Date Thu, 06 Nov 2008 13:49:13 GMT
On Thu, 2008-11-06 at 18:04 +0530, hemant wrote:
> On Wed, Nov 5, 2008 at 6:43 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> > On Wed, 2008-11-05 at 18:02 +0530, hemant wrote:
> >> Hi,
> >>
> >> I am using httpcore-nio 4.0 beta 2, client extensions for consuming a
> >> web service which uses http push. I am quite perplexed by the behavior
> >> of library where its eating all the throw exceptions thrown in any of
> >> the callback methods silently.
> >>
> >
> > They are not. In the asynchronous I/O model all events including
> > exceptions can be reported to the caller through a callback interface
> > only. One needs to provide the protocol handler with an instance of
> > EventListener in order to get notified of I/O and protocol errors.
> >
> >> Case in point, I am instantiating a ConsumingEntity in
> >> responseEntity() call, for handling responses asynchronously.
> >> Someitmes, my code in consumeContent() method throws unhandled
> >> exception, which is silently ignored.
> >>
> >> Is this the default behaviour? I am using this library from scala.
> >>
> >
> > Yes, it is, unless an instance of EventListener is injected to the
> > protocol handler.
> 
> Well, I do have EventListenter attached. So all unhandled exceptions
> are logged in as IOException (even though exception raised inside
> attached callback methods is something else ?). Anyways, thanks for
> the pointer.
> 
> 

One needs to differentiate two types of exceptions: 

(1) I/O and HTTP protocol exceptions that occur in the context of one
particular connection, which usually result in termination of that
connection but do not affect other connections and the I/O reactor
itself

(2) Runtime and I/O connections that are fatal and usually result in
termination of the I/O reactor along with all active connections.  

What kind of exception are you referring to?

At any rate, HttpCore should _never_ ever silently discard exceptions
(barring a few special cases such as a force-shutdown of a Socket)

> >
> > HttpCore NIO is quite complex and poorly documented at the moment. I am
> > working on a tutorial to improve the situation, but it is still
> > incomplete and not so well written.
> >
> > http://wiki.apache.org/HttpComponents/HttpCoreTutorial
> 
> Hmm, I wasn't aware of existance of above page, thanks again. But I
> think, javadoc would with inline documentation will be nicer solution.
> Do you accept documentation patch? (Now that, I am somewhat familiar
> with NIO API and internal implementation?)
> 

Happily! I'd be delighted

Oleg

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


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


Mime
View raw message