You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2009/09/05 12:49:57 UTC

[jira] Resolved: (HTTPCORE-205) AbstractMultiworkerIOReactor needs optional Latch to signal when ready.

     [ https://issues.apache.org/jira/browse/HTTPCORE-205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCORE-205.
----------------------------------------

    Resolution: Won't Fix

>  1) uses old wait-forever ( no ability to "give up" )

I do not think this is the case. ListenerEndpoint#close() can be used to shut down the listener even before it is fully initialized

> 2) Cannot monitor a set of ListenerEndPoints all at once. 

I am not entirely sure the changes you are proposing would fix the problem.

I have made some changes to the javadocs based on your suggestions. If you are willing to work on a better implementation of ListenerEndPointsImpl feel free to raise a separate JIRA and submit a patch.

Oleg

> AbstractMultiworkerIOReactor needs optional Latch to signal when ready.
> -----------------------------------------------------------------------
>
>                 Key: HTTPCORE-205
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-205
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.0.1
>            Reporter: Patrick Moore
>             Fix For: 4.1
>
>         Attachments: AbstractMultiworkerIOReactor.patch
>
>
> AbstractMultiworkerIOReactor may take some time getting ready ( needs to start threads for example ). In order to ensure that it is ready before starting to send requests, a CountDownLatch is needed.
> This is important for our test suites which are launch the reactor and then immediately trying to hit it. ( and failing ) 
>             for (int i = 0; i < this.workerCount; i++) {
>                 if (this.status != IOReactorStatus.ACTIVE) {
>                     return;
>                 }
>                 this.threads[i].start();
>             }
>  LINE 303: this.countDownLatch.countDown(); <<<<<<<           
>             for (;;) {
>                 int readyCount;
>                 try {
>                     readyCount = this.selector.select(this.selectTimeout);
>                 } catch (InterruptedIOException ex) {
>                     throw ex;
>                 } catch (IOException ex) {
>                     throw new IOReactorException("Unexpected selector failure", ex);
>                 }

-- 
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