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

Worker registration can go wrong if name has been used before #452

Closed
nhoening opened this issue Jul 2, 2022 · 1 comment
Closed

Worker registration can go wrong if name has been used before #452

nhoening opened this issue Jul 2, 2022 · 1 comment
Labels

Comments

@nhoening
Copy link
Contributor

nhoening commented Jul 2, 2022

An RQ worker registering under the name we choose for it, might fail to do that if a previous instance is not yet properly de-registered. E.g. when the old one died and the one starts right away:

  File "/home/seita/.virtualenvs/seita-flexmeasures/lib/python3.8/site-packages/flexmeasures/cli/jobs.py", line 59, in run_worker
    worker.work()
  File "/home/seita/.virtualenvs/seita-flexmeasures/lib/python3.8/site-packages/rq/worker.py", line 561, in work
    self.register_birth()
  File "/home/seita/.virtualenvs/seita-flexmeasures/lib/python3.8/site-packages/rq/worker.py", line 299, in register_birth
    raise ValueError(msg.format(self.name))
ValueError: There exists an active worker named 'RQ worker 4 [Seita]' already

Here is the error in our Sentry.

Maybe we can catch this error and append something to the name.

@nhoening
Copy link
Contributor Author

I think this was fixed within PR #455, see these lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant