Return-Path: Delivered-To: apmail-hc-dev-archive@www.apache.org Received: (qmail 59457 invoked from network); 5 Sep 2009 20:45:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Sep 2009 20:45:20 -0000 Received: (qmail 18529 invoked by uid 500); 5 Sep 2009 20:45:19 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 18438 invoked by uid 500); 5 Sep 2009 20:45:19 -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 18428 invoked by uid 99); 5 Sep 2009 20:45:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 20:45:19 +0000 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; Sat, 05 Sep 2009 20:45:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7E7D7234C051 for ; Sat, 5 Sep 2009 13:44:57 -0700 (PDT) Message-ID: <1315526395.1252183497501.JavaMail.jira@brutus> Date: Sat, 5 Sep 2009 13:44:57 -0700 (PDT) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Subject: [jira] Commented: (HTTPCORE-205) AbstractMultiworkerIOReactor needs optional Latch to signal when ready. In-Reply-To: <2139937028.1252022997507.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCORE-205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751789#action_12751789 ] Oleg Kalnichevski commented on HTTPCORE-205: -------------------------------------------- > re #1 ---I meant that you need a waitFor(int time, TimeUnit timeUnit) throws TimeoutException; method on ListenerEndPoint True. This is a fuck-up on my part. However given the fact that it takes only a few milliseconds for listener endpoint to become available or fail, absence of this method may not be a such big problem for most application. > then the user can supply their own implementation of ListenerEndPoint I am not convinced this is good idea. In this case a custom impl of ListeningIOReactor should be more appropriate. Anyways, do feel free to submit a patch with changes you deem necessary. Please note we will not be able to commit such a patch until 5.0 if it breaks API compatibility with 4.x 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