Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From zmqrpc.py, there're two new added methods send_to_client and recv_from_client for the messaging with client.
locust/locust/rpc/zmqrpc.py
Lines 14 to 27 in 87a9aa1
In method send_to_client msg.node_id is supposed to be a str object, while in the context of zmqrpc msg.node_id will be assigned with the addr from the return tuple of recv_from_client, which was a bytes object.
This consistency will cause the encoding issue of addr where it's referenced, including the example below
locust/locust/web.py
Lines 126 to 134 in 87a9aa1
the slave.id is also assigned with addr and it will be a bytes object which will cause an exception thrown from jsonify: "TypeError: Object of type 'bytes' is not JSON serializable".