Author: mahadev Date: Thu Jan 21 03:08:47 2010 New Revision: 901510 URL: http://svn.apache.org/viewvc?rev=901510&view=rev Log: ZOOKEEPER-647. hudson failure in testLeaderShutdown (flavio via mahadev)
Modified: hadoop/zookeeper/trunk/CHANGES.txt hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java Modified: hadoop/zookeeper/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=901510&r1=901509&r2=901510&view=diff ============================================================================== --- hadoop/zookeeper/trunk/CHANGES.txt (original) +++ hadoop/zookeeper/trunk/CHANGES.txt Thu Jan 21 03:08:47 2010 @@ -202,6 +202,8 @@ ZOOKEEPER-608. Receipt of ACK from observer should not be logged as ERROR (henry via mahadev) + ZOOKEEPER-647. hudson failure in testLeaderShutdown (flavio via mahadev) + IMPROVEMENTS: ZOOKEEPER-473. cleanup junit tests to eliminate false positives due to "socket reuse" and failure to close client (phunt via mahadev) Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java?rev=901510&r1=901509&r2=901510&view=diff ============================================================================== --- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java (original) +++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java Thu Jan 21 03:08:47 2010 @@ -560,33 +560,32 @@ this.finish(); } - while (running && !shutdown && channel != null) { + try { + while (running && !shutdown && channel != null) { - ByteBuffer b = null; - try { - ArrayBlockingQueue<ByteBuffer> bq = queueSendMap.get(sid); - if(bq != null) - b = bq.poll(1000, TimeUnit.MILLISECONDS); - else { - LOG.error("No queue of incoming messages for server " + sid); - this.finish(); - } - } catch (InterruptedException e) { - LOG.warn("Interrupted while waiting for message on queue", - e); - continue; - } - - try { - if(b != null){ - lastMessageSent.put(sid, b); - send(b); + ByteBuffer b = null; + try { + ArrayBlockingQueue<ByteBuffer> bq = queueSendMap.get(sid); + if(bq != null) + b = bq.poll(1000, TimeUnit.MILLISECONDS); + else { + LOG.error("No queue of incoming messages for server " + sid); + break; + } + + if(b != null){ + lastMessageSent.put(sid, b); + send(b); + } + } catch (InterruptedException e) { + LOG.warn("Interrupted while waiting for message on queue", + e); } - } catch (Exception e) { - LOG.warn("Exception when using channel: " + sid, e); - this.finish(); } + } catch (Exception e) { + LOG.warn("Exception when using channel: " + sid, e); } + this.finish(); LOG.warn("Send worker leaving thread"); } }