Skip to content

Commit

Permalink
reset callbacks map in MS.listen to allow RemoveTest to restart it
Browse files Browse the repository at this point in the history
  • Loading branch information
jbellis committed Jan 12, 2012
1 parent 452ddf6 commit 1e75013
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/java/org/apache/cassandra/net/MessagingService.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public void convict(InetAddress ep)
*/ */
public void listen(InetAddress localEp) throws IOException, ConfigurationException public void listen(InetAddress localEp) throws IOException, ConfigurationException
{ {
callbacks.reset(); // hack to allow tests to stop/restart MS
for (ServerSocket ss: getServerSocket(localEp)) for (ServerSocket ss: getServerSocket(localEp))
{ {
SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp); SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp);
Expand Down Expand Up @@ -471,7 +472,7 @@ public void waitForStreaming() throws InterruptedException


public void clearCallbacksUnsafe() public void clearCallbacksUnsafe()
{ {
callbacks.clear(); callbacks.reset();
} }


/** /**
Expand All @@ -496,7 +497,6 @@ public void shutdown()
{ {
throw new IOError(e); throw new IOError(e);
} }

} }


public void receive(Message message, String id) public void receive(Message message, String id)
Expand Down
3 changes: 2 additions & 1 deletion src/java/org/apache/cassandra/utils/ExpiringMap.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ public void shutdown()
timer.cancel(); timer.cancel();
} }


public void clear() public void reset()
{ {
shutdown = false;
cache.clear(); cache.clear();
} }


Expand Down

0 comments on commit 1e75013

Please sign in to comment.