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

Fix "socket operation on non-socket" at shutdown, by reverting #1935 #1991

Merged
merged 4 commits into from
Jan 29, 2022
Merged
Show file tree
Hide file tree
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: 0 additions & 3 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,6 @@ def quit(self):
logger.debug("Sending quit message to client %s" % (client.id))
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
3 changes: 2 additions & 1 deletion locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def recv_from_client(self):
return msg.node_id, msg

def close(self):
pass
raise RPCError()

return MockedRpcServerClient

Expand Down Expand Up @@ -940,6 +940,7 @@ def _(*args, **kwargs):
self.assertEqual(2, worker.user_count)
# give time for users to generate stats, and stats to be sent to master
sleep(0.1)
master_env.events.quitting.fire(environment=master_env, reverse=True)
master.quit()
sleep(0.1)
# make sure users are killed
Expand Down