Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E072918492 for ; Tue, 12 Jan 2016 16:25:21 +0000 (UTC) Received: (qmail 49099 invoked by uid 500); 12 Jan 2016 16:25:21 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 49061 invoked by uid 500); 12 Jan 2016 16:25:21 -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 49037 invoked by uid 99); 12 Jan 2016 16:25:21 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jan 2016 16:25:21 +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 0CFB7180425 for ; Tue, 12 Jan 2016 16:25:21 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id PZ5H4qoDMFjZ for ; Tue, 12 Jan 2016 16:25:19 +0000 (UTC) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id EFA6F2156B for ; Tue, 12 Jan 2016 16:25:18 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id bc4so274639766lbc.2 for ; Tue, 12 Jan 2016 08:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=FXnYxp5gfV82t9ps7p8P3ehMGn8ZnofGVKtZvi/6vBI=; b=cB6eedXGBe4FG9u9ZhrBAKvw8FF4Ax0DGjjeUg3o5gxhYpK56DNeFjaHbYetNINlym 615MqcPixceNKmmMgonBspqYrJBZfUHb4AE+OvBYb4ZiWakpWQz8rhyyJcaU86wJ9nAW egAzQy9H/krIbKiRKA+tD6UUQhqoQ7C89awm3e21kIuR23663kqQ3i2Fq2PGnnFGHR6e jV+gnsSX8FWsRie7OPe68YlOEDoLkut/GYY3D6tWTB9kU+98yvpT8p7coyU7eu8IYU5q thC30cNXvQuLBAQsHmRqxzAVNpPNCVQ6/vU6Luz4j3wm3Yci5HoefrIg2gdkK1eNdUzC vfiA== MIME-Version: 1.0 X-Received: by 10.112.133.42 with SMTP id oz10mr48003570lbb.92.1452615918395; Tue, 12 Jan 2016 08:25:18 -0800 (PST) Received: by 10.112.200.70 with HTTP; Tue, 12 Jan 2016 08:25:18 -0800 (PST) Received: by 10.112.200.70 with HTTP; Tue, 12 Jan 2016 08:25:18 -0800 (PST) In-Reply-To: <1452614812.6521.12.camel@apache.org> References: <2356A8A3-B4FA-4DD4-A190-662DAB0DCDC6@gmail.com> <1452086834.15625.3.camel@apache.org> <1B94B260-077D-42FF-BF54-2445E9F44F93@gmail.com> <1452614812.6521.12.camel@apache.org> Date: Tue, 12 Jan 2016 08:25:18 -0800 Message-ID: Subject: Re: Default timeouts From: Gary Gregory To: HttpComponents Project Cc: Gaspard Petit Content-Type: multipart/alternative; boundary=047d7b3a8bfacfaa900529257fe6 --047d7b3a8bfacfaa900529257fe6 Content-Type: text/plain; charset=UTF-8 On Jan 12, 2016 8:06 AM, "Oleg Kalnichevski" wrote: > > On Sun, 2016-01-10 at 22:51 -0500, Gaspard Petit wrote: > > Hi Oleg, > > > > Thank you for taking the time to respond my comment. > > > > I agree with you that timeouts are not one-size-fits-all. However, I cannot think of any real-world application that would require to use an infinite timeout. When the SSL handshake has been waiting on the socket for over 2 days, there is no doubt that the application is in failure state and should either retry or abandon. > > > > The cases where infinite timeouts are useful, in my opinion, are strictly when debugging the code, to let you grab a coffee while stepping through the code. > > > > Anything between 20s and 2 minutes would be reasonable. I would personally go for something like this: > > > > Default SSL Handshake socket timeout : 30s > > Socket (Request) timeout : 30s > > Connection timeout : 60s > > > > Most likely, current HttpClient users are already defining their timeouts, so only few users should be negatively impacted by such a change. On the other end, any new user will immediately benefit from more practical default values. > > > > In the end, my biggest concern is the ssh socket timeout, since it is the most tricky to configure and a lot of sample code I found on the internet did not mention this timeout. If you are hesitating, I would at least set a finite default for that one. > > > > Gaspard > > As of 4.4 HttpClient uses connect timeout value for SSL handshake by > default. I hope this should be enough to address your biggest concern. > > I am a bit hesitant to set socket and connect timeouts to a positive > value by default as JRE default timeout values are 0 (no timeout). I think the JRE will never change that behavior due to compatibility. I think it is OK for us to use timeouts in version 5 to non-infinite values. It is just odd to have a default config that can cause an app to appear to hang by default. Gary > > Oleg > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org > For additional commands, e-mail: dev-help@hc.apache.org > --047d7b3a8bfacfaa900529257fe6--