Skip to content
Browse files

reset callbacks map in MS.listen to allow RemoveTest to restart it

  • Loading branch information...
1 parent 452ddf6 commit 1e750138177e9cd9cbd6537451a4b5cd301dab3a @jbellis jbellis committed Jan 11, 2012
View
4 src/java/org/apache/cassandra/net/MessagingService.java
@@ -228,6 +228,7 @@ public void convict(InetAddress ep)
*/
public void listen(InetAddress localEp) throws IOException, ConfigurationException
{
+ callbacks.reset(); // hack to allow tests to stop/restart MS
for (ServerSocket ss: getServerSocket(localEp))
{
SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp);
@@ -471,7 +472,7 @@ public void waitForStreaming() throws InterruptedException
public void clearCallbacksUnsafe()
{
- callbacks.clear();
+ callbacks.reset();
}
/**
@@ -496,7 +497,6 @@ public void shutdown()
{
throw new IOError(e);
}
-
}
public void receive(Message message, String id)
View
3 src/java/org/apache/cassandra/utils/ExpiringMap.java
@@ -121,8 +121,9 @@ public void shutdown()
timer.cancel();
}
- public void clear()
+ public void reset()
{
+ shutdown = false;
cache.clear();
}

0 comments on commit 1e75013

Please sign in to comment.
Something went wrong with that request. Please try again.