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

Add Logging to download_locustfile_from_master #2749

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

andrewbaldwin44
Copy link
Collaborator

@andrewbaldwin44 andrewbaldwin44 commented Jun 3, 2024

Explanation

This one is a bit tricky, the argument parser happens before the log setup, so we don't have access to the same log levels as we would in the rest of the application. I also didn't want to have tons of messages logging for no reason, so I placed the messaging outside of the while loop.

The problem with having the message outside of the while loop, is that we don't yet know if connecting to master failed or not (so it shouldn't really be a warning). However, without logging being setup it seems we only have warning level logs. So the warning level is a bit of a lie, but it does at least provide some feedback that the master needs to be connected in order for the worker to start

Fixes #2748

@cyberw
Copy link
Collaborator

cyberw commented Jun 3, 2024

It is a bit awkward, but could you try instead launching a greenlet with 60s delay that is only responsible for printing the message, and interrupt it once a message is received (or just skip printing the message if got_reply is true)

@andrewbaldwin44 andrewbaldwin44 force-pushed the bugfix/locustfile-download branch from 69055d1 to bf1f22f Compare June 4, 2024 11:50
locust/argument_parser.py Outdated Show resolved Hide resolved
@andrewbaldwin44 andrewbaldwin44 force-pushed the bugfix/locustfile-download branch from 924a4f4 to 739456a Compare June 4, 2024 16:14
@cyberw cyberw merged commit db9cae2 into locustio:master Jun 4, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log a warning if getting locustfile from master takes more than 60s
2 participants