jira-importer opened a new issue, #1145:
URL: https://github.com/apache/httpcomponents-core/issues/1145

   **[Anders 
Wallgren](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=awallgren)**
 opened 
**[HTTPCORE-169](https://issues.apache.org/jira/browse/HTTPCORE-169?redirect=false)**
 and commented
   
   I've finally had time to track down a problem that's been happening 
intermittently for the past few weeks.
   
   The symptom of the problem is that the IOReactor shuts down during one of 
our unit tests (always the same test).
   
   The test before the test that fails cancels an NIO session request before it 
completes, and I believe what might be happening is this session request ends 
up being processed by the IOReactor during the next test (the IOReactor remains 
running between these tests).
   
   AbstractIOReactor.processNewChannels calls 
AbstractSelectableChannel.configureBlocking, which throws a 
ClosedChannelException.
   
   AbstractIOReactor.processNewChannels reacts to this by throwing an 
IOReactorException, which in turn causes AbstractMultiworkerIOReactor.execute 
to call doShutdown.
   
   This is an expected error condition, so it shouldn't cause the IOReactor to 
exit.
   
   I'm including some supporting stack traces below -- note that I added some 
logging to the 4.0-beta2 code, so I'm also including patch files so line 
numbers can line up (though you probably won't need them -- the problem seems 
straightfoward to me).
   
   The ClosedChannelException happens:
   2008-08-17T16:35:27.424 | DEBUG | ntHttpManager |                            
                   | AbstractMultiworkerIOReactor   | Worker exception in 
execute()
   org.apache.http.nio.reactor.IOReactorException: Failure registering channel 
with the selector
   at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels(AbstractIOReactor.java:227)
   at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:158)
   at 
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:70)
   at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:341)
   at java.lang.Thread.run(Thread.java:619)
   at com.electriccloud.util.queue.CommanderThread.run(CommanderThread.java:94)
   Caused by: java.nio.channels.ClosedChannelException
   at 
java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSelectableChannel.java:252)
   at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processNewChannels(AbstractIOReactor.java:224)
   ... 5 more
   
   Right after that, the shutdown happens:
   
   2008-08-17T16:35:27.425 | INFO  | ntHttpManager |                            
                   | AbstractIOReactor              | gracefulShutdown: 
org.apache.http.impl.nio.reactor.BaseIOReactor@46f28c
   java.lang.Exception: Stack trace from gracefulShutdown
   at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.gracefulShutdown(AbstractIOReactor.java:338)
   at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.doShutdown(AbstractMultiworkerIOReactor.java:240)
   at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:203)
   at 
com.electriccloud.commander.agent.AgentSocketManager.innerRun(AgentSocketManager.java:280)
   at com.electriccloud.util.FailsafeRunnable.run(FailsafeRunnable.java:136)
   at java.lang.Thread.run(Thread.java:619)
   
   
   ---
   
   **Affects:** 4.0-beta2
   
   **Attachments:**
   - 
[HTTPCORE-169.patch](https://issues.apache.org/jira/secure/attachment/12388470/HTTPCORE-169.patch)
 (_7.72 kB_)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to