Return-Path: X-Original-To: apmail-hc-httpclient-users-archive@www.apache.org Delivered-To: apmail-hc-httpclient-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 67FF518FA5 for ; Fri, 4 Sep 2015 17:40:02 +0000 (UTC) Received: (qmail 53372 invoked by uid 500); 4 Sep 2015 17:40:02 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 53327 invoked by uid 500); 4 Sep 2015 17:40:02 -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 53315 invoked by uid 99); 4 Sep 2015 17:40:01 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2015 17:40:01 +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 28450182107 for ; Fri, 4 Sep 2015 17:40:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.106 X-Spam-Level: X-Spam-Status: No, score=-0.106 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.006, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=elyograg.org Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8hB4E7d5sW4H for ; Fri, 4 Sep 2015 17:39:53 +0000 (UTC) Received: from frodo.elyograg.org (frodo.elyograg.org [166.70.79.219]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 57715506EE for ; Fri, 4 Sep 2015 17:39:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by frodo.elyograg.org (Postfix) with ESMTP id 407DD509D for ; Fri, 4 Sep 2015 11:39:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=elyograg.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mail; t= 1441388391; bh=7GeKuo+YyC7PezF15KEzHA/YKijMXAEPIhXaMazZs9k=; b=A ASq4b9gI9HtYvAWfi6abN/1iYtjgqyaU5sCzCBX2Mrdq26eLP/sf7RKpagdrNMuZ ZuD3c+uNu1GvIoC+Opg7MAoADdv90qX+y25UERRdm5xvCPxrInGJ5tnwxpsM//kO Pr0QP7YfbfiLk/EKmGPhWpfhRuYr5AESOaKwU3C5FM= X-Virus-Scanned: Debian amavisd-new at frodo.elyograg.org Received: from frodo.elyograg.org ([127.0.0.1]) by localhost (frodo.elyograg.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VBYrcTVd3fW9 for ; Fri, 4 Sep 2015 11:39:51 -0600 (MDT) Received: from [10.2.0.108] (client175.mainstreamdata.com [209.63.42.175]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: elyograg@elyograg.org) by frodo.elyograg.org (Postfix) with ESMTPSA id BDD575083 for ; Fri, 4 Sep 2015 11:39:50 -0600 (MDT) Subject: Re: Getting SocketTimeoutException after a very short amount of time To: HttpClient User Discussion References: <55E3BE59.8070305@elyograg.org> <1441011726.27084.4.camel@apache.org> <55E87BDC.5010402@elyograg.org> <55E89BE9.6060108@elyograg.org> <1441374791.12559.2.camel@apache.org> From: Shawn Heisey X-Enigmail-Draft-Status: N1110 Message-ID: <55E9D764.8060106@elyograg.org> Date: Fri, 4 Sep 2015 11:39:48 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1441374791.12559.2.camel@apache.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 9/4/2015 7:53 AM, Oleg Kalnichevski wrote: > I added socket timeout logging to the 4.5.x branch and trunk > > http://svn.apache.org/r1701258 > > I clearly those values logged when executing HttpClient examples. I abandoned my custom httpcore jar built from the 4.4.1 tag with the one line addition, pulled down the 4.5.x branch of httpclient, and built it. I replaced httpclient-4.5.jar with httpclient-4.5.1-SNAPSHOT.jar, and verified that the commit you made was included in the source code that I checked out. Because I am using slf4j which ultimately logs to log4j1, I do have the jcl-over-slf4j jar in my classpath, which should capture the commons logging that httpclient uses. I put the following in my log4j.properties file: log4j.logger.org.apache.http=DEBUG, file During program startup (when I build the HttpClient objects), I do not see any logs from httpclient at all, but when it actually connects to Solr, I do see DEBUG logs. Those debug logs do not include the "set socket timeout" log entry that you added. One of the logs says this: DEBUG - 2015-09-04 11:38:01.551; 262; 3; Connection [id: 1][route: {}->http://bigindy5.REDACTED.com:8982] can be kept alive indefinitely I must be creating the client objects incorrectlyfor the "set socket timeout" message to never be logged. So you don't have to go looking back through the thread, here is the code I'm using: /* Trying out a new way of creating clients */ RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(900000) .setConnectTimeout(15000) .build(); httpClient = HttpClients.custom() .setDefaultRequestConfig(requestConfig) .setMaxConnPerRoute(300) .setMaxConnTotal(5000) .build(); RequestConfig optimizeRequestConfig = RequestConfig.custom() .setSocketTimeout(7200000) .setConnectTimeout(15000) .build(); optimizeHttpClient = HttpClients.custom() .setDefaultRequestConfig(optimizeRequestConfig) .build(); Thanks, Shawn --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org