Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5376F925D for ; Tue, 22 May 2012 11:54:51 +0000 (UTC) Received: (qmail 54616 invoked by uid 500); 22 May 2012 11:54:48 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 54560 invoked by uid 500); 22 May 2012 11:54:48 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 54551 invoked by uid 99); 22 May 2012 11:54:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 11:54:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kjkoster@gmail.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 May 2012 11:54:41 +0000 Received: by wibhm14 with SMTP id hm14so2739515wib.0 for ; Tue, 22 May 2012 04:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=gEE+3Yi2pz1gB6LPP9TDDXrB3pRZKfBGmHGFbBJJGSs=; b=SVHh3BOuNxlLax33E5UkuIUjEq1/MkNQaq/UdXrfZ/RnHlIfN5TNVT0Xn2N8XmhFb5 /rSj39IDQSY9/Tro7n1vK8+PhpTFXA14vDuxFMZozmHudfRSrqRWGd546yTkh2Q85hPu VjeGJadjqT7UHwQ0O9oaVRG/ND1J9SXw+QRUBgPjWAXn730xP6uyI9iBTGOERHzORh3c kgLQdUUtGO13/Co7/71dHjYWNlNFWcfktLnmkkkR0+l2cb98ZG1MT0CkLoY/skTigPeq CpsCACO7VBweKnLpd69uyjmvuesboX0TyLUewJAUuV0wH5SF8mMFFoinWZX3ZpLsW5RR ilFg== Received: by 10.180.102.3 with SMTP id fk3mr34590555wib.9.1337687660433; Tue, 22 May 2012 04:54:20 -0700 (PDT) Received: from [192.168.20.227] ([130.117.252.5]) by mx.google.com with ESMTPS id et10sm32532349wib.2.2012.05.22.04.54.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 May 2012 04:54:19 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1278) Subject: Re: connection reset errors From: Kees Jan Koster In-Reply-To: <4FBB62E9.4090406@ice-sa.com> Date: Tue, 22 May 2012 13:54:17 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <66593FBF-28EE-4714-B635-665E8C8108DC@gmail.com> <4FBB62E9.4090406@ice-sa.com> To: "Tomcat Users List" X-Mailer: Apple Mail (2.1278) X-Virus-Checked: Checked by ClamAV on apache.org Dear Andr=E9, > Assuming that your client is really connecting to that HTTP connector = on port 8080 mentioned above.. Yes, it has a forwarded port 80 (using FreeBSD ipfw) that also points to = 8080, and there is an Apache with mod_proxy_http that hooks into 8081. = My tests are on the vanilla port, though. > 1) You are getting a > java.net.SocketException: Connection reset > at java.net.SocketInputStream.read(SocketInputStream.java:168) >=20 > so this appears to happen when/while your java client is reading the = response from the server, and it appears to be that the client is = expecting to be able to read more data, but finds itself unable to, = because the socket has been closed "under his nose". The reading is one area I need to look into: did the client get all = data, partial data or none at all. I need to experiment with that. > You say that it happens "frequently", so it's not always. Indeed, not always. About 1 in 10 posts die like this on bad days. = Sometimes hours with no issues. No pattern I can discern. > 2) the server itself seems unaware that there is a problem. So it has = already written the whole response back to the client, decided it was = done with this request, and gone happily to handle other things. Precisely. > That can happen, even if the client has not yet received all data, = because between the server and the client there is a lot of piping, and = the data may buffered at various levels or still "in transit". >=20 > thus.. >=20 > - either the client is misinterpreting the amount of data that it = should be reading from the server's response (trying to read more than = there actually is) > (on the other hand, I think that the kind of exception you would get = in that case would be different, more like "trying to read beyond EOF" = or so). > - or something in-between the server and the client closes the = connection before all data has been returned to the client (and/or is = loosing data). >=20 > It would be helpful to know if this happens when the response is = particularly large, or small, or if it is unrelated to the response = size. The response is a few bytes. I think it is about 10-20 bytes. Less than = a packet, I expect. :) > If the server is configured with an AccessLogValve, you should be able = to see how big the response was, in bytes. If you have control over the = client code, you should be able to add something that logs how many = bytes it has read before the exception occurs. What makes the request size interesting? What previous experience are = you basing this question on? > Dumping the response HTTP headers to the client logfile would also = help finding out what happens. (If the client is an applet running = inside of a browser, then a browser add-on would show this easily (like = "Live HTTP Headers" for Firefox, or Fiddler2 for IE)). I can check that I see the same problems from a browser using firebug, = that is a good idea. Thanks. > Doing a "traceroute" from the client to the server, may also give an = idea of what there is actually between the server and the client. mtr reports no packet loss between the two machines I used for testing. > And if this all still does not provide any clues, then you're down to = a network packet trace, using Wireshark or similar. Packet traces I was hoping to avoid. :( -- Kees Jan http://java-monitor.com/ kjkoster@kjkoster.org +31651838192 The secret of success lies in the stability of the goal. -- Benjamin = Disraeli --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org