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 healthcheck for worker and scheduler process #303

Open
stinovlas opened this issue Mar 4, 2024 · 2 comments
Open

Add healthcheck for worker and scheduler process #303

stinovlas opened this issue Mar 4, 2024 · 2 comments

Comments

@stinovlas
Copy link
Contributor

It's common practice to add perform healtchecks inside containers in dockerized environment. If healthcheck fails do pass within defined parameters, docker daemon restarts the container. HTTP / uwsgi process usually allows the healthcheck using curl or uwsgi_curl. The situation is much more chaotic with servers, but it should be possible to provide some CLI to check that worker or scheduler is working properly.

Right now, I could add custom job that just returns some sentinel (e.g. fixed string). By kicking that job and checking for result, I could verify that worker process is up and running and processing kicked tasks. Similar check could be performed for scheduler. This is not very convenient, because I have to add a new module with custom healthcheck task to each project deployment (or to the project itself, which doesn't make a lot of sense).

What do you think about adding such healthcheck task to taskiq itself? It could provide new subcommand taskiq check or taskiq healthcheck (or maybe taskiq status?) that would kick the job and check its result. The exit code of this CLI tool would then signify the check result (it could also write some useful info to stdout). Scheduler check could be performed similarly (maybe by scheduling task for now()), but I didn't think that through yet.

@devraj
Copy link

devraj commented Mar 6, 2024

@stinovlas this is of interest to us as well and I had a discussion going with @s3rius some months ago on it.

@francipvb
Copy link

Hello,

For worker processes this should be fairly simple, provided that the broker has a result backend.

The scheduler can be an issue, however.

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

No branches or pull requests

3 participants