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

Ensure heartbeat_worker doesnt try to re-establish connection to workers when quit has been called #1972

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
10 changes: 9 additions & 1 deletion locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,8 @@ def quit(self):
self.server.send_to_client(Message("quit", None, client.id))
gevent.sleep(0.5) # wait for final stats report from all workers
self.server.close()
# ensure heartbeat_worker doesnt try to re-establish connection to workers and throw lots of exceptions
self.clients._worker_nodes = {}
self.greenlet.kill(block=True)

def check_stopped(self):
Expand Down Expand Up @@ -867,7 +869,13 @@ def client_listener(self):
try:
client_id, msg = self.server.recv_from_client()
except RPCError as e:
logger.error("RPCError found when receiving from client: %s" % (e))
if self.clients.ready:
logger.error("RPCError found when receiving from client: %s" % (e))
else:
logger.debug(
"RPCError found when receiving from client: %s (but no clients were expected to be connected anyway)"
% (e)
)
self.connection_broken = True
gevent.sleep(FALLBACK_INTERVAL)
continue
Expand Down