hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCORE-29) DefaultConnectingIOReactor.execute propagates IOException, but isn't really re-callable
Date Thu, 25 Jan 2007 22:47:49 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467675
] 

Oleg Kalnichevski commented on HTTPCORE-29:
-------------------------------------------

> The session that had the problem should be shut down, but the reactor should not fail
Anders,
Once a new session is open it gets immediately passed onto a dedicated I/O thread. The selector
on the main thread is used exclusively to open new sessions, while I/O events of running sessions
are managed by selectors on separate I/O threads. Should any session throw an IO exception
it would trigger an event on the dispatch interface but would definitely not shut down the
I/O reactor along with other active sessions.  The execute method can terminate with an I/O
exception only if the main selector is for some reason unable to open new sessions, which
in my opinion is a problem severe enough to warrant the shutdown of the I/O reactor. 

I'll review the code one more time, but I do not think the I/O reactor can actually throw
any IO exception that can be automatically recovered from. Can you provide me with a stack
trace of an exception that you think should be recovered from automatically? 

Oleg

> DefaultConnectingIOReactor.execute propagates IOException, but isn't really re-callable
> ---------------------------------------------------------------------------------------
>
>                 Key: HTTPCORE-29
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-29
>             Project: HttpComponents Core
>          Issue Type: Bug
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha3
>            Reporter: Anders Wallgren
>         Assigned To: Oleg Kalnichevski
>             Fix For: 4.0-alpha4
>
>
> I'm trying to figure out what to do when DefaultConnectingIOReactor.execute throws an
exception.  It doesn't seem like I can just call execute() again after handling the exception,
since that will recreate all the state in DCIOR.
> Seems to me that there needs to be a different way to handle exceptions, or the execute
method should be callable more than once.
> For reference, here's the stack trace of an exception:
> {code}
> 2007-01-23T16:23:19.800 | ERROR | urceInvoker |                                     
         | NewResourceInvoker             | Invalid argument: sun.nio.ch.Net.setIntOption
> java.net.SocketException: Invalid argument: sun.nio.ch.Net.setIntOption
> 	at sun.nio.ch.Net.setIntOption0(Native Method)
> 	at sun.nio.ch.Net.setIntOption(Net.java:154)
> 	at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
> 	at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
> 	at sun.nio.ch.SocketOptsImpl$IP$TCP.noDelay(SocketOptsImpl.java:284)
> 	at sun.nio.ch.OptionAdaptor.setTcpNoDelay(OptionAdaptor.java:48)
> 	at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:268)
> 	at org.apache.http.nio.impl.reactor.DefaultConnectingIOReactor.prepareSocket(DefaultConnectingIOReactor.java:171)
> 	at org.apache.http.nio.impl.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:158)
> 	at org.apache.http.nio.impl.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:134)
> 	at org.apache.http.nio.impl.reactor.DefaultConnectingIOReactor.execute(DefaultConnectingIOReactor.java:94)
> 	at com.electriccloud.commander.domain.NewResourceInvoker.innerRun(NewResourceInvoker.java:304)
> 	at com.electriccloud.util.FailsafeRunnable.run(FailsafeRunnable.java:105)
> 	at java.lang.Thread.run(Thread.java:619)
> {code}

-- 
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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message