Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63E9018C2B for ; Fri, 29 May 2015 13:55:17 +0000 (UTC) Received: (qmail 26359 invoked by uid 500); 29 May 2015 13:55:17 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 26322 invoked by uid 500); 29 May 2015 13:55:17 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 26310 invoked by uid 99); 29 May 2015 13:55:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 13:55:17 +0000 Date: Fri, 29 May 2015 13:55:17 +0000 (UTC) From: "Petr Miko (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-6427) Incorrect Response InputStream closing in AbstractClient MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Petr Miko created CXF-6427: ------------------------------ Summary: Incorrect Response InputStream closing in AbstractClient Key: CXF-6427 URL: https://issues.apache.org/jira/browse/CXF-6427 Project: CXF Issue Type: Bug Affects Versions: 2.7.16 Reporter: Petr Miko In current implementation of AbstractClient is response body input stream closed in following method {noformat} protected boolean responseStreamCanBeClosed(Message outMessage, Class cls) { return cls != InputStream.class && MessageUtils.isTrue(outMessage.getContextualProperty("response.stream.auto.close")); } {noformat} That means, that in case that if the response.stream.auto.close is not set to true, the input stream stays opened -> Socket is not free for reusing. In my opinion the proper implementation should be: {noformat} protected boolean responseStreamCanBeClosed(Message outMessage, Class cls) { return !cls.isAssignableFrom(InputStream.class) || MessageUtils.isTrue(outMessage.getContextualProperty("response.stream.auto.close")); } {noformat} This way is the response body input stream: * is closed even when the auto close property is not set (= default?) and cls is not a child of InputStream * the input stream is not closed, if cls is child of InputStream class (do not know if there might be cases of its subclasses) The current implementation is in my opinion incorrect, because in case of a lot quick/parallel requests over proxy clients we faced running out of Sockets - similarly to what is described in CXF-5144 -- This message was sent by Atlassian JIRA (v6.3.4#6332)