cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasobr...@apache.org
Subject [3/4] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Tue, 08 Apr 2014 23:29:41 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	src/java/org/apache/cassandra/net/OutboundTcpConnection.java


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/66b3b2bf
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/66b3b2bf
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/66b3b2bf

Branch: refs/heads/trunk
Commit: 66b3b2bf08577e7a6256318f1fc42e91b0c5d232
Parents: 76db70e 47ace44
Author: Jason Brown <jasobrown@apple.com>
Authored: Tue Apr 8 16:28:33 2014 -0700
Committer: Jason Brown <jasobrown@apple.com>
Committed: Tue Apr 8 16:28:33 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/net/OutboundTcpConnection.java | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/66b3b2bf/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/66b3b2bf/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 2bfa491,8b8872b..1781a5d
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@@ -142,39 -132,26 +142,39 @@@ public class OutboundTcpConnection exte
                      throw new AssertionError(e);
                  }
  
 -                BlockingQueue<QueuedMessage> tmp = backlog;
 -                backlog = active;
 -                active = tmp;
              }
 +            currentMsgBufferCount = drainedMessages.size();
  
 -            MessageOut<?> m = qm.message;
 -            if (m == CLOSE_SENTINEL)
 +            int count = drainedMessages.size();
 +            for (QueuedMessage qm : drainedMessages)
              {
 -                disconnect();
 -                if (isStopped)
 -                    break;
 -                continue;
 +                try
 +                {
 +                    MessageOut<?> m = qm.message;
 +                    if (m == CLOSE_SENTINEL)
 +                    {
 +                        disconnect();
 +                        if (isStopped)
 +                            break outer;
 +                        continue;
 +                    }
-                     if (qm.timestamp < System.currentTimeMillis() - m.getTimeout())
++                    if (qm.isTimedOut(m.getTimeout()))
 +                        dropped.incrementAndGet();
 +                    else if (socket != null || connect())
 +                        writeConnected(qm, count == 1 && backlog.size() == 0);
 +                    else
 +                        // clear out the queue, else gossip messages back up.
 +                        backlog.clear();
 +                }
 +                catch (Exception e)
 +                {
 +                    // really shouldn't get here, as exception handling in writeConnected()
is reasonably robust
 +                    // but we want to catch anything bad we don't drop the messages in the
current batch
 +                    logger.error("error processing a message intended for {}", poolReference.endPoint(),
e);
 +                }
 +                currentMsgBufferCount = --count;
              }
 -            if (qm.isTimedOut(m.getTimeout()))
 -                dropped.incrementAndGet();
 -            else if (socket != null || connect())
 -                writeConnected(qm);
 -            else
 -                // clear out the queue, else gossip messages back up.
 -                active.clear();
 +            drainedMessages.clear();
          }
      }
  


Mime
View raw message