[ 
https://issues.apache.org/jira/browse/HTTPCORE-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608793#action_12608793
 ] 

Oleg Kalnichevski commented on HTTPCORE-164:
--------------------------------------------

> For some reasons not driven from application 
> DefaultConnectingIOReactor#execute(IOEventDispatch eventDispatch); method 
> exits 
> without throwing IOException or any other exception.

Bizarre. As far as I can tell I/O reactor can terminate either due to an 
IOReactorException or an explicit shutdown() invocation. 

Anyway, IO reactor is not supposed to terminate quietly if something is not 
okay. In any case it should attempt to cleanly shutdown all its I/O dispatch 
worker before calling it quits.

Very, very odd.

>            public boolean handle(RuntimeException ex) {
>                getLog().error("RuntimeException occured while processing 
> request", ex);
>                // in any case we should preserve ioreactor alive
>                return true;
>  

This pretty much explains it. I would VERY STRONGLY advise against doing that. 
It is much better to let the reactor terminate cleanly on an runtime exception 
and restart it instead of leaving it running in a zombie state. 

What you are doing is very, very wrong. 

> And the most important question is how do you suggest to catch the cases when 
> reactor or one of its workers crashed?

First off, you should not ignore exceptions indiscriminately. You should allow 
fatal exceptions to propagate. This will enable the I/O reactor to react to an 
exception and shut down its I/O dispatch threads cleanly. If the reactor 
terminates due to an exception is should be safe just to restart it.

Oleg


> DefaultConnectingIOReactor throws ConcurrentModificationException in 
> processEvents() method
> -------------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-164
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-164
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.0-beta2
>         Environment: Win XP
> JDK 1.6.0-b105
> httpcore-nio-beta2-20080510.140437-10.jar
> httpcore-beta2-20080510.140437-10.jar
>            Reporter: Denis Rogov
>            Priority: Critical
>
> Using httpcomponents nio to serve as http client. 
> Occasionally getting exception that stops reactor and therefore all engine 
> work:
> Exception in thread "IO Reactor Execution Thread" 
> java.util.ConcurrentModificationException
>       at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
>       at java.util.HashMap$KeyIterator.next(HashMap.java:827)
>       at 
> org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:93)
>       at 
> org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:162)
>       at 
> <...>HttpManagerApacheAsyncEngineImpl$1.run(HttpManagerApacheAsyncEngineImpl.java:294)
>       at java.lang.Thread.run(Thread.java:619)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to