mirror of https://github.com/apache/cassandra
Fix unreleased resource sockets
patch by Arunkumar M; reviewed by yukim for CASSANDRA-12330
This commit is contained in:
parent
86a73d439c
commit
83cc2ed3af
|
|
@ -1,5 +1,5 @@
|
|||
3.0.10
|
||||
* Fix potential socket leak (CASSANDRA-12329)
|
||||
* Fix potential socket leak (CASSANDRA-12329, CASSANDRA-12330)
|
||||
* Fix ViewTest.testCompaction (CASSANDRA-12789)
|
||||
* Improve avg aggregate functions (CASSANDRA-12417)
|
||||
* Preserve quoted reserved keyword column names in MV creation (CASSANDRA-11803)
|
||||
|
|
|
|||
|
|
@ -47,15 +47,24 @@ public class DefaultConnectionFactory implements StreamConnectionFactory
|
|||
int attempts = 0;
|
||||
while (true)
|
||||
{
|
||||
Socket socket = null;
|
||||
try
|
||||
{
|
||||
Socket socket = OutboundTcpConnectionPool.newSocket(peer);
|
||||
socket = OutboundTcpConnectionPool.newSocket(peer);
|
||||
socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout());
|
||||
socket.setKeepAlive(true);
|
||||
return socket;
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
if (socket != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
socket.close();
|
||||
}
|
||||
catch (IOException ignore) {}
|
||||
}
|
||||
if (++attempts >= MAX_CONNECT_ATTEMPTS)
|
||||
throw e;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue