[
https://issues.apache.org/jira/browse/CASSANDRA-3887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13205817#comment-13205817
]
Peter Schuller commented on CASSANDRA-3887:
-------------------------------------------
564 is the final line of receive():
{code}
public void receive(Message message, String id)
{
if (logger_.isTraceEnabled())
logger_.trace(FBUtilities.getBroadcastAddress() + " received " +
message.getVerb()
+ " from " + id + "@" + message.getFrom());
message = SinkManager.processServerMessage(message, id);
if (message == null)
return;
Runnable runnable = new MessageDeliveryTask(message, id);
ExecutorService stage = StageManager.getStage(message.getMessageType());
assert stage != null : "No stage for message type " +
message.getMessageType();
stage.execute(runnable);
}
{code}
FYI, I'm including the diff of MessagingService.java in our branch relative to
upstream 1.1 (not intended for inclusion, just FYI).
{code}
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java
b/src/java/org/apache/cassandra/net/MessagingService.java
index 3375b84..d7613cb 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -366,6 +366,14 @@ public final class MessagingService implements
MessagingServiceMBean
return Integer.toString(idGen.incrementAndGet());
}
+ /*
+ * @see #sendRR(Message message, InetAddress to, IMessageCallback cb, long
timeout)
+ */
+ public String sendRR(Message message, InetAddress to, IMessageCallback cb)
+ {
+ return sendRR(message, to, cb, DEFAULT_CALLBACK_TIMEOUT);
+ }
+
/**
* Send a message to a given endpoint. This method specifies a callback
* which is invoked with the actual response.
@@ -376,11 +384,12 @@ public final class MessagingService implements
MessagingServiceMBean
* @param cb callback interface which is used to pass the responses or
* suggest that a timeout occurred to the invoker of the send().
* suggest that a timeout occurred to the invoker of the send().
+ * @param timeout the timeout used for expiration
* @return an reference to message id used to match with the result
*/
- public String sendRR(Message message, InetAddress to, IMessageCallback cb)
+ public String sendRR(Message message, InetAddress to, IMessageCallback cb,
long timeout)
{
- String id = addCallback(cb, message, to, message.getMessageTimeout());
+ String id = addCallback(cb, message, to, timeout);
sendOneWay(message, id, to);
return id;
}
{code}
> NPE on start-up due to missing stage
> -------------------------------------
>
> Key: CASSANDRA-3887
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3887
> Project: Cassandra
> Issue Type: Bug
> Reporter: Peter Schuller
> Priority: Minor
>
> On 1.1 (with our patches, but fairly sure they aren't involved):
> {code}
> INFO [main] 2012-02-10 17:57:26,220 StorageService.java (line 768) JOINING:
> waiting for ring and schema information
> ERROR [Thread-6] 2012-02-10 17:57:26,333 AbstractCassandraDaemon.java (line
> 139) Fatal exception in thread Thread[Thread-6,5,main]
> java.lang.NullPointerException
> at
> org.apache.cassandra.net.MessagingService.receive(MessagingService.java:564)
> at
> org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:160)
> at
> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:96)
> ERROR [Thread-8] 2012-02-10 17:57:26,334 AbstractCassandraDaemon.java (line
> 139) Fatal exception in thread Thread[Thread-8,5,main]
> java.lang.NullPointerException
> at
> org.apache.cassandra.net.MessagingService.receive(MessagingService.java:564)
> at
> org.apache.cassandra.net.IncomingTcpConnection.receiveMessage(IncomingTcpConnection.java:160)
> at
> org.apache.cassandra.net.IncomingTcpConnection.run(IncomingTcpConnection.java:96)
> {code}
> That NPE is after an assertion (not triggered due to lack of -ea). Race on
> start-up - getting messages before stages set up? (not investigating further
> right now)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira