Skip to content

Commit

Permalink
Fix unknown worker spawning message
Browse files Browse the repository at this point in the history
  • Loading branch information
ykvch committed Feb 27, 2023
1 parent 42c46f1 commit d73612f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,11 @@ def client_listener(self) -> NoReturn:
elif msg.type == "stats":
self.environment.events.worker_report.fire(client_id=msg.node_id, data=msg.data)
elif msg.type == "spawning":
self.clients[msg.node_id].state = STATE_SPAWNING
try:
self.clients[msg.node_id].state = STATE_SPAWNING
except KeyError:
logger.warning(f"Got spawning message from unknown worker {msg.node_id}. Asking worker to quit.")
self.server.send_to_client(Message("quit", None, msg.node_id))
elif msg.type == "spawning_complete":
self.clients[msg.node_id].state = STATE_RUNNING
self.clients[msg.node_id].user_classes_count = msg.data["user_classes_count"]
Expand Down

0 comments on commit d73612f

Please sign in to comment.