Fix changing keys during iteration in matchmaker heartbeat

When starting heartbeat in matchmaker-redis, keys may be changed
during iteration and a runtime exception is thrown as follows:

RuntimeError: dictionary changed size during iteration

Change-Id: I016a449674619294196055614c62c2856002291c
Closes-Bug: #1432966
This commit is contained in:
Li Ma 2015-03-17 00:07:12 -07:00
parent ec68634d91
commit 72a9984d8f
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ class HeartbeatMatchMakerBase(MatchMakerBase):
Use start_heartbeat to spawn a heartbeat greenthread,
which loops this method.
"""
for key, host in self.host_topic:
for key, host in self.host_topic.keys():
self.ack_alive(key, host)
def ack_alive(self, key, host):