Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AB451200C70 for ; Thu, 20 Apr 2017 05:21:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A9C2E160BB3; Thu, 20 Apr 2017 03:21:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C9A7F160BAA for ; Thu, 20 Apr 2017 05:21:09 +0200 (CEST) Received: (qmail 31076 invoked by uid 500); 20 Apr 2017 03:21:09 -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 31065 invoked by uid 99); 20 Apr 2017 03:21:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Apr 2017 03:21:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6F80B1A02CD for ; Thu, 20 Apr 2017 03:21:08 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 9C5kAaVNcS33 for ; Thu, 20 Apr 2017 03:21:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id AF3875FDCF for ; Thu, 20 Apr 2017 03:21:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id C24FDE0BDD for ; Thu, 20 Apr 2017 03:21:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7EFB821B56 for ; Thu, 20 Apr 2017 03:21:04 +0000 (UTC) Date: Thu, 20 Apr 2017 03:21:04 +0000 (UTC) From: "wang qi (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HTTPASYNC-119) The client dose not check if the IO thread is alive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 20 Apr 2017 03:21:10 -0000 [ https://issues.apache.org/jira/browse/HTTPASYNC-119?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:all-tabpanel ] wang qi updated HTTPASYNC-119: ------------------------------ Description:=20 When I developed with the latest HttpAsyncclient, it was hard for me to kno= w whether the IO thread in BaseIOReactor was alive=E3=80=82 For example, if= I throw an error in the callback=EF=BC=8Cthe IO thread will terminate,but = the connecting thread will not check if the IO thread is alive,and will st= ill add new channels to the dispatcher=E3=80=82 The java code: CloseableHttpAsyncClient client =3D HttpAsyncClients.custom().build(); client.start(); HttpUriRequest getRequest =3D new HttpGet("www.google.com"); client.execute(getRequest, new FutureCallback() { @Override public void completed(HttpResponse result) { throw new StackOverflowError(); } @Override public void failed(Exception ex) { } @Override public void cancelled() { } }); for(int i =3D 0 ; i < 100 ; i++){ client.execute(getRequest, new FutureCallback() { @Override public void completed(HttpResponse result) { =20 } @Override public void failed(Exception ex) { } @Override public void cancelled() { } }); } one of the IO threads is dead=EF=BC=8Cbut the java Error dose not be caught= =EF=BC=8Cand hte client will continue work and add new channels to the disp= ather, but the newChannel queue will be not be consumed, so I want to know = is there any method to deal with this situation. Thanks was: When I developed with HttpAsyncclient, it was hard for me to know whether t= he IO thread in BaseIOReactor was alive=E3=80=82 For example, if I throw an= error in the callback=EF=BC=8Cthe IO thread will terminate,but the connect= ing thread will not check if the IO thread is alive,and will still add new= channels to the dispatcher=E3=80=82 The java code: CloseableHttpAsyncClient client =3D HttpAsyncClients.custom().build(); client.start(); HttpUriRequest getRequest =3D new HttpGet("www.google.com"); client.execute(getRequest, new FutureCallback() { @Override public void completed(HttpResponse result) { throw new StackOverflowError(); } @Override public void failed(Exception ex) { } @Override public void cancelled() { } }); for(int i =3D 0 ; i < 100 ; i++){ client.execute(getRequest, new FutureCallback() { @Override public void completed(HttpResponse result) { =20 } @Override public void failed(Exception ex) { } @Override public void cancelled() { } }); } one of the IO threads is dead=EF=BC=8Cbut the java Error dose not be caught= =EF=BC=8Cand hte client will continue work and add new channels to the disp= ather, but the newChannel queue will be not be consumed, so I want to know = is there any method to deal with this situation. Thanks > The client dose not check if the IO thread is alive > --------------------------------------------------- > > Key: HTTPASYNC-119 > URL: https://issues.apache.org/jira/browse/HTTPASYNC-119 > Project: HttpComponents HttpAsyncClient > Issue Type: Bug > Environment: Mac OSX, Java 8 > Reporter: wang qi > > When I developed with the latest HttpAsyncclient, it was hard for me to k= now whether the IO thread in BaseIOReactor was alive=E3=80=82 For example, = if I throw an error in the callback=EF=BC=8Cthe IO thread will terminate,bu= t the connecting thread will not check if the IO thread is alive,and will = still add new channels to the dispatcher=E3=80=82 > The java code: > CloseableHttpAsyncClient client =3D HttpAsyncClients.custom().build(); > client.start(); > HttpUriRequest getRequest =3D new HttpGet("www.google.com"); > client.execute(getRequest, new FutureCallback() { > @Override > public void completed(HttpResponse result) { > throw new StackOverflowError(); > } > @Override > public void failed(Exception ex) { > } > @Override > public void cancelled() { > } > }); > for(int i =3D 0 ; i < 100 ; i++){ > client.execute(getRequest, new FutureCallback()= { > @Override > public void completed(HttpResponse result) { > =20 > } > @Override > public void failed(Exception ex) { > } > @Override > public void cancelled() { > } > }); > } > one of the IO threads is dead=EF=BC=8Cbut the java Error dose not be caug= ht=EF=BC=8Cand hte client will continue work and add new channels to the di= spather, but the newChannel queue will be not be consumed, so I want to kno= w is there any method to deal with this situation. > Thanks -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org