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 B4F00200BB1 for ; Thu, 20 Oct 2016 01:03:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B381A160AFF; Wed, 19 Oct 2016 23:03:01 +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 0609A160AFB for ; Thu, 20 Oct 2016 01:03:00 +0200 (CEST) Received: (qmail 95236 invoked by uid 500); 19 Oct 2016 23:03:00 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 95100 invoked by uid 99); 19 Oct 2016 23:03:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 23:03:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EEB932C4C73 for ; Wed, 19 Oct 2016 23:02:59 +0000 (UTC) Date: Wed, 19 Oct 2016 23:02:59 +0000 (UTC) From: "Yuki Morishita (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-12330) Unreleased Resource: Sockets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 19 Oct 2016 23:03:01 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yuki Morishita updated CASSANDRA-12330: --------------------------------------- Status: Ready to Commit (was: Patch Available) > Unreleased Resource: Sockets > ---------------------------- > > Key: CASSANDRA-12330 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12330 > Project: Cassandra > Issue Type: Sub-task > Components: Core, Streaming and Messaging > Reporter: Eduardo Aguinaga > Assignee: Arunkumar M > Labels: easyfix, newbie, patch > Fix For: 3.x > > Attachments: 12330-3.0.txt, 12330-3.0.txt > > > Overview: > In May through June of 2016 a static analysis was performed on version 3.0.5 of the Cassandra source code. The analysis included an automated analysis using HP Fortify v4.21 SCA and a manual analysis utilizing SciTools Understand v4. The results of that analysis includes the issue below. > Issue: > Sockets are low level resources that must be explicitly released so subsequent callers will have access to previously used sockets. In the file DefaultConnectionFactory.java on line 52 a socket is acquired and eventually returned to the caller on line 55. > If an exception is thrown by any of the code between lines 52 and 55 the socket acquired on line 52 will not be released for subsequent reuse. > DefaultConnectionFactory.java, lines 50-73: > {code:java} > 50 try > 51 { > 52 Socket socket = OutboundTcpConnectionPool.newSocket(peer); > 53 socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout()); > 54 socket.setKeepAlive(true); > 55 return socket; > 56 } > 57 catch (IOException e) > 58 { > 59 if (++attempts >= MAX_CONNECT_ATTEMPTS) > 60 throw e; > 61 > 62 long waitms = DatabaseDescriptor.getRpcTimeout() * (long)Math.pow(2, attempts); > 63 logger.warn("Failed attempt {} to connect to {}. Retrying in {} ms. ({})", attempts, peer, waitms, e); > 64 try > 65 { > 66 Thread.sleep(waitms); > 67 } > 68 catch (InterruptedException wtf) > 69 { > 70 throw new IOException("interrupted", wtf); > 71 } > 72 } > 73 } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)