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

multiple workers? #39

Open
zetaab opened this issue Apr 9, 2024 · 3 comments
Open

multiple workers? #39

zetaab opened this issue Apr 9, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@zetaab
Copy link

zetaab commented Apr 9, 2024

I have tried to debug how this codecov/worker works and it looks like its launching celery beat per worker instance. And if multiple beats are executed the tasks are duplicated as well. Which basically means that there is no way to run multiple worker instances?

So my question is: is there way to run multiple instances? Is codecov really running one worker in production?

@thomasrockhu-codecov thomasrockhu-codecov added the question Further information is requested label Apr 16, 2024
@thomasrockhu-codecov
Copy link
Contributor

@jason-ford-codecov let me know if you can help

@zetaab
Copy link
Author

zetaab commented Apr 16, 2024

and the part which starts the beat worker is here https://github.com/codecov/worker/blob/main/main.py#L108

from https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html#introduction

You have to ensure only a single scheduler is running for a schedule at a time, otherwise you’d end up with duplicate tasks. Using a centralized approach means the schedule doesn’t have to be synchronized, and the service can operate without using locks.

One way of making this scalable is that there could be one beat worker and multiple normal workers (which should execute normal tasks).

@jason-ford-codecov
Copy link
Contributor

Thank you for the feedback. We consider our worker tasks idempotent and we run multiple workers and have duplicate tasks. We are going to investigate moving to a single beat worker as an optimization.

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

No branches or pull requests

4 participants