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 8B358200B68 for ; Fri, 19 Aug 2016 17:03:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 89B10160AAB; Fri, 19 Aug 2016 15:03:02 +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 CF708160A79 for ; Fri, 19 Aug 2016 17:03:01 +0200 (CEST) Received: (qmail 95275 invoked by uid 500); 19 Aug 2016 15:03:00 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 95258 invoked by uid 99); 19 Aug 2016 15:03:00 -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; Fri, 19 Aug 2016 15:03:00 +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 3C3F71A52F2 for ; Fri, 19 Aug 2016 15:03:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 6bcEtZa1QFhz for ; Fri, 19 Aug 2016 15:02:58 +0000 (UTC) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 948775F571 for ; Fri, 19 Aug 2016 15:02:40 +0000 (UTC) Received: by mail-it0-f47.google.com with SMTP id e63so30199424ith.1 for ; Fri, 19 Aug 2016 08:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Vku2fKExq77FJx34vxm/UYWCvcKD6E4Y+3dj6j1jLCQ=; b=ui8VDu5u55XH+5xwNqcUIDhgxvOc3asTuY58I5xJlFX26EAwEyMrUt3YYFhuuX3cyp 6Fb/gScst71Wlp3sS2opdCi2r1YuOmpyqSF22hcwTif1FiIZTpzAFTey4qjLXcy8KwyN Nd+PiWni3Kgr08itE/Z/t4VJTxo3hegygy3PPQcAp/QjCjE40f29bTpn6URBbU7BY1kl MCxrJpXX+MPAbuZK9hBin6oGJt5Kou087s1GKztuAoEeX+OrcjCiA6TbBHRXDdq4lkBM iQ6s+sBlSS6U4QztMxXFJOLeGuYsiiyDZqxSEosSVu1Vgimu4HLji4A2ktGFrsd23DhX 4qfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Vku2fKExq77FJx34vxm/UYWCvcKD6E4Y+3dj6j1jLCQ=; b=K1OmdRZZbOxqPue2lY1d9LE7NY/oAVsJ+iAEF7wI1h5+P+rIaSo/Vygdp/fchRXyGh 3M5zabUbTcjrH2IpPxomCQZeQ/R+YsVl93FXFZIcL587nUgPYi0KhnsblxioBVRM8dZv 8pUC2r2Q6kxf+oEzIs7azqMSp3STGkkAzlD2M2F4qmngGx4eiDcCazsW/euWNfc4G8Dy 594DCfEyVps4w3DKOSIIin9eR7VNsp9MEW6palBVQAJTQjccWPQKagreXO9nB+gVVAgg pCVXOTYV6KfIevFrAWhtjJfC2DAV/rF5zj5TEoGI+KYQ21fsqcaJ8u8vZ+NDrrBwr/eL mByw== X-Gm-Message-State: AEkoouvawn1R5zZOZCqQdiz3fwHTtEU1U4Yzr/VN/SGgP18bG2PWk4qKkaM3YsYAboDlZzSV8q/wUojTf12kuA== X-Received: by 10.36.7.68 with SMTP id f65mr6698027itf.39.1471618907666; Fri, 19 Aug 2016 08:01:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.69.228 with HTTP; Fri, 19 Aug 2016 08:01:47 -0700 (PDT) In-Reply-To: References: From: David Motes Date: Fri, 19 Aug 2016 11:01:47 -0400 Message-ID: Subject: Re: Can a 201 (Created) response cause HTTP async client to prematurely send a FIN to the server? To: HttpClient User Discussion Content-Type: multipart/alternative; boundary=001a1143eedc3c7edd053a6dfaf3 archived-at: Fri, 19 Aug 2016 15:03:02 -0000 --001a1143eedc3c7edd053a6dfaf3 Content-Type: text/plain; charset=UTF-8 The response code should be sent back after the entire request has been processed. You cannot send a 201 created back after the headers and then discover something is wrong with the body and change the response code to some kind of error, it is too late. Your server needs to be changed to send that response code upon completion of the request. On Fri, Aug 19, 2016 at 10:47 AM, Sachin Nikumbh wrote: > Hi all, > > I realized that in my previous post, I did not do a good job of explaining > the problem that I am facing. My sincere apologies for that. > > We have a custom server that my client Java application is communicating > with using the async client. To be specific we are using an instance of > CloseableHttpAsyncClient from the client application. The client sends a > POST request with few kilo bytes of data. The server reads the headers, > sends a 201 back to the client acknowledging the receipt of request and > continues reading with the request body. What I see using wireshark on the > client side is that the client receives 201 when it is still in the middle > of sending the data. But then the client sends a FIN even before it has > sent all the data. This results in server not receiving all the data. > > Now, if we remove the server 201 response, everything works fine. I.e > client sends all the data to the server. We also don't see this behavior if > the client sends small amount of data < 3 kb. > > Is this a known issue? Are there any client side hooks that I can use to > fix/debug this issue? > > Any help would be greatly appreciated. > > Thanks > Sachin > --001a1143eedc3c7edd053a6dfaf3--