Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 26269 invoked from network); 18 Aug 2008 20:36:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Aug 2008 20:36:38 -0000 Received: (qmail 25884 invoked by uid 500); 18 Aug 2008 20:36:36 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 25745 invoked by uid 500); 18 Aug 2008 20:36:36 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 25242 invoked by uid 99); 18 Aug 2008 20:36:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2008 13:36:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Aug 2008 20:35:45 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 69DAB234C1B8 for ; Mon, 18 Aug 2008 13:35:44 -0700 (PDT) Message-ID: <1164682550.1219091744432.JavaMail.jira@brutus> Date: Mon, 18 Aug 2008 13:35:44 -0700 (PDT) From: "Anders Wallgren (JIRA)" To: dev@hc.apache.org Subject: [jira] Commented: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down In-Reply-To: <60217622.1219025924293.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623454#action_12623454 ] Anders Wallgren commented on HTTPCORE-169: ------------------------------------------ FYI, I deleted the other two patch files that only applied my log lines, so they don't cause confusion with the patch that has the code change in it. > ClosedChannelException causes IOReactor to shut down > ---------------------------------------------------- > > Key: HTTPCORE-169 > URL: https://issues.apache.org/jira/browse/HTTPCORE-169 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO > Affects Versions: 4.0-beta2 > Reporter: Anders Wallgren > Priority: Critical > Fix For: 4.0-beta3 > > Attachments: HTTPCORE-169.patch > > > 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) -- 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: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org