diff --git a/locust/argument_parser.py b/locust/argument_parser.py index a00bbe1f6e..cdbf4e6339 100644 --- a/locust/argument_parser.py +++ b/locust/argument_parser.py @@ -219,7 +219,7 @@ def download_locustfile_from_master(master_host: str, master_port: int) -> str: def ask_for_locustfile(): while not got_reply: - tempclient.send(Message("locustfile", None, client_id)) + tempclient.send(Message("locustfile", {"version": version}, client_id)) gevent.sleep(1) def log_warning(): diff --git a/locust/runners.py b/locust/runners.py index 459799ac45..fe8a2e14f1 100644 --- a/locust/runners.py +++ b/locust/runners.py @@ -1039,6 +1039,11 @@ def client_listener(self) -> NoReturn: # 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 == "locustfile": + if msg.data["version"][0:4] == __version__[0:4]: + logger.debug( + f"A worker ({msg.node_id}) running a different patch version ({msg.data['version']}) connected, master version is {__version__}" + ) + logging.debug("Worker requested locust file") assert self.environment.parsed_locustfiles locustfile_options = self.environment.parsed_locustfiles