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 3F0B3200CE7 for ; Thu, 17 Aug 2017 16:15:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3D9D616AF77; Thu, 17 Aug 2017 14:15:07 +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 8382916AF78 for ; Thu, 17 Aug 2017 16:15:06 +0200 (CEST) Received: (qmail 26448 invoked by uid 500); 17 Aug 2017 14:15:04 -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 26424 invoked by uid 99); 17 Aug 2017 14:15:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Aug 2017 14:15:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 88E731805C2 for ; Thu, 17 Aug 2017 14:15:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id dJ5IoWT0ol3c for ; Thu, 17 Aug 2017 14:15:02 +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 A06E75FC7B for ; Thu, 17 Aug 2017 14:15:01 +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 DD5AAE09A7 for ; Thu, 17 Aug 2017 14:15:00 +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 9309025381 for ; Thu, 17 Aug 2017 14:15:00 +0000 (UTC) Date: Thu, 17 Aug 2017 14:15:00 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCORE-482) org.apache.http.nio.protocol.HttpAsyncService returns an empty response when a socket timeout is detected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 17 Aug 2017 14:15:07 -0000 [ https://issues.apache.org/jira/browse/HTTPCORE-482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16130459#comment-16130459 ] ASF subversion and git services commented on HTTPCORE-482: ---------------------------------------------------------- Commit a5f3bb9e989a232d864d986d7a1d2145032c59c6 in httpcomponents-core's branch refs/heads/4.4.x from [~garydgregory] [ https://git-wip-us.apache.org/repos/asf?p=httpcomponents-core.git;h=a5f3bb9 ] [HTTPCORE-482] org.apache.http.nio.protocol.HttpAsyncService does returns an empty response when a socket timeout is detected > org.apache.http.nio.protocol.HttpAsyncService returns an empty response when a socket timeout is detected > --------------------------------------------------------------------------------------------------------- > > Key: HTTPCORE-482 > URL: https://issues.apache.org/jira/browse/HTTPCORE-482 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO > Affects Versions: 4.4.6 > Environment: org.apache.http.nio.protocol.HttpAsyncService does returns an empty response when a socket timeout is detected > Reporter: Gary Gregory > Assignee: Gary Gregory > Fix For: 4.4.7 > > Attachments: httpcomponents-core-4.4.x.patch > > > org.apache.http.nio.protocol.HttpAsyncService does returns an empty response when a socket timeout is detected. > When a timeout occurs in an async proxy when an origin server takes too long to reply, HttpAsyncService returns empty response. > You can reproduce this issue with our async example {{NHttpReverseProxy}}: > Start it with: http://postman-echo.com 8888 > Then run: > {noformat} > curl --verbose --max-time 1000 http://localhost:8888/delay/3 > {noformat} > and you will get an EMPTY response from the server, no HTTP status code where I would expect a 504 or 500. > The proxy prints out: > {noformat} > Reverse proxy to http://postman-echo.com:80 > [client->proxy] connection open 127.0.0.1:8888<->127.0.0.1:61128 > [client->proxy] 00000001 GET /delay/3 HTTP/1.1 > [client->proxy] 00000001 request completed > [proxy->origin] connection open 192.168.0.112:61130<->52.44.234.173:80 > [proxy->origin] 00000001 GET /delay/3 HTTP/1.1 > [proxy->origin] 00000001 request completed > [client->proxy] connection closed 127.0.0.1:8888<->127.0.0.1:61128 > [client<-proxy] 00000001 java.net.SocketTimeoutException > [proxy->origin] connection released 192.168.0.112:61130<->52.44.234.173:80 > [proxy->origin] [total kept alive: 0; total allocated: 0 of 100] > [proxy->origin] connection closed 192.168.0.112:61130<->52.44.234.173:80 > {noformat} > Curl prints: > {noformat} > * STATE: INIT => CONNECT handle 0x600057930; line 1410 (connection #-5000) > * Added connection 0. The cache now contains 1 members > * STATE: CONNECT => WAITRESOLVE handle 0x600057930; line 1446 (connection #0) > * Trying ::1... > * TCP_NODELAY set > * STATE: WAITRESOLVE => WAITCONNECT handle 0x600057930; line 1527 (connection #0) > * Trying 127.0.0.1... > * TCP_NODELAY set > * Connected to localhost (127.0.0.1) port 8888 (#0) > * STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x600057930; line 1579 (connection #0) > * Marked for [keep alive]: HTTP default > * STATE: SENDPROTOCONNECT => DO handle 0x600057930; line 1597 (connection #0) > > GET /delay/3 HTTP/1.1 > > Host: localhost:8888 > > User-Agent: curl/7.54.1 > > Accept: */* > > > * STATE: DO => DO_DONE handle 0x600057930; line 1676 (connection #0) > * STATE: DO_DONE => WAITPERFORM handle 0x600057930; line 1801 (connection #0) > * STATE: WAITPERFORM => PERFORM handle 0x600057930; line 1811 (connection #0) > * STATE: PERFORM => DONE handle 0x600057930; line 1980 (connection #0) > * multi_done > * Empty reply from server > * Connection #0 to host localhost left intact > * Expire cleared > curl: (52) Empty reply from server > {noformat} > I have a fix that returns a 504 GATEWAY_TIMEOUT when a socket timeout is detected. > Please see branch HTTPCORE-482 in git. Build passes with {{mvn clean verify}}. I also attached the changes as a patch in {{httpcomponents-core-4.4.x.patch}}. > I have not created a unit test patch but the above scenario now works. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org