Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop client_listener from raising a KeyError when receiving a client_stopped message from unknown worker #2102

Merged
merged 2 commits into from
May 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,9 @@ def client_listener(self):
# if abs(time() - msg.data["time"]) > 5.0:
# warnings.warn("The worker node's clock seem to be out of sync. For the statistics to be correct the different locust servers need to have synchronized clocks.")
elif msg.type == "client_stopped":
if msg.node_id not in self.clients:
logger.warning(f"Received {msg.type} message from an unknown client: {msg.node_id}.")
continue
client = self.clients[msg.node_id]
del self.clients[msg.node_id]
if self._users_dispatcher is not None:
Expand Down