On Mon, 2007-12-03 at 20:24 +0000, Jake C wrote: 
> Thanks for the reply!
> 
> Sorry for the long delay in reply, I suddenly got really busy last week... :-)
> 
> > Subject: Re: HttpCore NIOSSL fatal exception
> > From: [EMAIL PROTECTED]
> > To: [email protected]
> > Date: Wed, 28 Nov 2007 12:35:51 +0100
> >
> >
> > On Wed, 2007-11-28 at 04:37 +0100, Roland Weber wrote:
> >>
> >>> Do these "reactor worker threads" have a limited shelf life,
> >>> and have to be "exercised" every once it a while?
> >>
> >> As with all worker threads: if they fail to work, throw them away
> >> and replace them. But you may want to know why the worker failed.
> >> Because if there's something wrong in the environment, the newly
> >> started ones will also fail.
> 
> If this does end up being a recoverable error, how do I go about replacing 
> them? They were created in the constructor for DefaultListeningIOReactor. Do 
> I need to call shutdown on the ioRector instance and create a new one?
> 
> I definitely want to know why. I will be following up with the NIO list. I 
> hope I don't have to go to Sun... :-/
> 

Jake,

You can prevent the worker threads from terminating by "handling"
exceptions using IOReactorExceptionHandler. In case the handler is not
provided or the handling method returns false, the worker thread will
store the exception in a local variable and terminate. The I/O reactor
in its turn will detect the fatal failure condition, re-throw the
original exception and gracefully shut down itself along with the
remaining worker threads. One can still recover from this condition by
catching the exception and restating the I/O reactor  

Hope this helps

Oleg


> > Generally it is a pretty bad idea to do anything with _generic_
> > RuntimeException as semantically they are meant to represent
> > non-recoverable exceptions.
> >
> > As of HttpCore 4.0-alpha6 you can register a custom
> > IOReactorExceptionHandler to inject application specific exception
> > handling logic for I/O and runtime exceptions that are deemed
> > non-fatal:
> >
> > http://jakarta.apache.org/httpcomponents/httpcomponents-core/httpcore-nio/xref/org/apache/http/nio/reactor/IOReactorExceptionHandler.html
> >
> > Hope this helps
> >
> > Oleg
> 
> This may end up being a fatal error, and the "handling" may be to restart the 
> app, or even a reboot. However, without knowing that there was even a 
> problem, I couldn't do even that until I get a phone call that notifications 
> are not going through. That would remove a couple 9's from my uptime. :-) 
> I'll check out the new IOReactorExceptionHandler. Knowing there was an error 
> is definitely the first step.
> _________________________________________________________________
> Share life as it happens with the new Windows Live.Download today it's FREE!
> http://www.windowslive.com/share.html?ocid=TXT_TAGLM_Wave2_sharelife_112007
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to