avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1499035 - in /avro/trunk: CHANGES.txt lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java
Date Tue, 02 Jul 2013 17:45:37 GMT
Author: cutting
Date: Tue Jul  2 17:45:37 2013
New Revision: 1499035

URL: http://svn.apache.org/r1499035
Log:
AVRO-1293. Java: Fix potential deadlock in NettyTransceiver. Contributed by James Baldassari.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1499035&r1=1499034&r2=1499035&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Jul  2 17:45:37 2013
@@ -112,6 +112,9 @@ Trunk (not yet released)
     AVRO-1171. Avro C++ Json Decoder: Double cannot be decoded (Sam
     Overend via thiru)
 
+    AVRO-1293. Java: Fix potential deadlock in NettyTransceiver.
+    (James Baldassari via cutting)
+
 Avro 1.7.4 (22 February 2012)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java?rev=1499035&r1=1499034&r2=1499035&view=diff
==============================================================================
--- avro/trunk/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java (original)
+++ avro/trunk/lang/java/ipc/src/main/java/org/apache/avro/ipc/NettyTransceiver.java Tue Jul
 2 17:45:37 2013
@@ -296,11 +296,17 @@ public class NettyTransceiver extends Tr
     Map<Integer, Callback<List<ByteBuffer>>> requestsToCancel = null;
     boolean stateReadLockHeld = stateLock.getReadHoldCount() != 0;
 
+    ChannelFuture channelFutureToCancel = null;
     synchronized(channelFutureLock) {
         if (stopping && channelFuture != null) {
-           channelFuture.cancel();
+          channelFutureToCancel = channelFuture;
+          channelFuture = null;
         }
     }
+    if (channelFutureToCancel != null) {
+      channelFutureToCancel.cancel();
+    }
+    
     if (stateReadLockHeld) {
       stateLock.readLock().unlock();
     }



Mime
View raw message