You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Anders Wallgren (JIRA)" <ji...@apache.org> on 2008/08/18 04:18:44 UTC

[jira] Created: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

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
         Attachments: AbstractIOReactor.patch, AbstractMultiworkerIOReactor.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


[jira] Updated: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anders Wallgren updated HTTPCORE-169:
-------------------------------------

    Attachment:     (was: AbstractMultiworkerIOReactor.patch)

> 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


[jira] Updated: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCORE-169:
---------------------------------------

    Fix Version/s: 4.0-beta3

Sounds reasonable. Would you be willing to submit a patch with a fix for the problem and possibly a test case for it?

Oleg

> 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: AbstractIOReactor.patch, AbstractMultiworkerIOReactor.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


[jira] Commented: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@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


[jira] Resolved: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-169.
----------------------------------------

    Resolution: Fixed

Patch checked in. Many thanks, Anders

Oleg

> 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


[jira] Updated: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anders Wallgren updated HTTPCORE-169:
-------------------------------------

    Attachment:     (was: AbstractIOReactor.patch)

> 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


[jira] Commented: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623434#action_12623434 ] 

Anders Wallgren commented on HTTPCORE-169:
------------------------------------------

I'll work on that -- the patch is easy, the test case may take a few days to get to, given my current schedule.

> 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: AbstractIOReactor.patch, AbstractMultiworkerIOReactor.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


[jira] Updated: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anders Wallgren updated HTTPCORE-169:
-------------------------------------

    Attachment: HTTPCORE-169.patch

Patch based on the beta2 code.

> 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


[jira] Updated: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anders Wallgren updated HTTPCORE-169:
-------------------------------------

    Attachment: AbstractMultiworkerIOReactor.patch
                AbstractIOReactor.patch

Patch files that include my added logging statements, so the stack traces will make sense to you.

> 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
>         Attachments: AbstractIOReactor.patch, AbstractMultiworkerIOReactor.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


[jira] Commented: (HTTPCORE-169) ClosedChannelException causes IOReactor to shut down

Posted by "Anders Wallgren (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-169?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623246#action_12623246 ] 

Anders Wallgren commented on HTTPCORE-169:
------------------------------------------

A potential fix would seem to be to catch the ClosedChannelException explicitly and just call SessionRequest.failed:

        ChannelEntry entry;
        while ((entry = this.newChannels.poll()) != null) {
            SocketChannel channel;
            SelectionKey key;
            try {
                channel = entry.getChannel();
                channel.configureBlocking(false);
                key = channel.register(this.selector, 0);
            } catch (ClosedChannelException ex) {
                SessionRequestImpl sessionRequest = entry.getSessionRequest();
                if (sessionRequest != null) {
                    sessionRequest.failed(ex);
                }
                return;

            } catch (IOException ex) {
                throw new IOReactorException("Failure registering channel " +
                        "with the selector", ex);
            }

I'm testing this fix now.

> 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
>         Attachments: AbstractIOReactor.patch, AbstractMultiworkerIOReactor.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