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

New worker health check gets blocked by long-running jobs #1112

Closed
michaelbromley opened this issue Sep 23, 2021 · 2 comments
Closed

New worker health check gets blocked by long-running jobs #1112

michaelbromley opened this issue Sep 23, 2021 · 2 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@michaelbromley
Copy link
Member

Describe the bug
The health check for the worker added in v1.2.0 can get blocked by long running jobs, since it relies on the job queue to get an "ack" from the worker.

To Reproduce
Steps to reproduce the behavior:

  1. Trigger some long-running jobs up to the limit of concurrency
  2. Make a request to the /health endpoint
  3. The 'check-worker-health' job will be blocked, waiting for the other jobs to complete before it is taken off the queue.
  4. After 10 seconds the health check will time out and Vendure thinks the worker is dead.

Expected behavior
The health check should always return the correct result.

Environment (please complete the following information):

  • @vendure/core version: 1.2.0
@michaelbromley michaelbromley added the type: bug 🐛 Something isn't working label Sep 23, 2021
@michaelbromley michaelbromley self-assigned this Sep 23, 2021
@michaelbromley
Copy link
Member Author

Did some user research via Slack:

Question

I want to know:

  1. Did you run into this in testing or prod so far?
  2. Is the worker health check valuable for you?
  3. Do you have any suggestions for a solution?

I know that for some users, a worker health check is not really needed because they monitor the worker process/container independently using the hosting infrastructure. Want to get some more opinions and experiences with this to guide how I handle this. Thanks! 🙏


Answer 1
Well, We're probably going to run the worker in a separate CloudRun container, so we won't need that.

Answer 2

  1. Yes, have this on prod/dev while reindexing, but then up the concurrency of worker
  2. No, it is not valuable
  3. Now we get ack from worker. Maybe worker can sent ack?

Answer 3

  1. I also ran into the issue while reindexing
  2. I can get by without it. I have a keep-alive thing on my server that pings the app every 5 mins.
  3. Given 1&2 I just want some way to disable it

@michaelbromley
Copy link
Member Author

michaelbromley commented Sep 28, 2021

I have just been exploring ways to mitigate this issue and have come to the conclusion that the entire health check should probably be removed. Reasons:

  1. I cannot see a good solution to the inherent problem of checking health by queuing a job which can get blocked.
  2. The /health endpoint of the server will show "down" if the worker is down. This is probably not wanted. The server health check should be independent of the worker.
  3. The health check job spams the job queue.

This will technically be a breaking change but I think we could consider it "reverting a failed experiment" in the next minor release.

edit: actually it would be better to keep it in for now, deprecate it but allow it to still be switched off/on by some kind of configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant