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

Server running in worker mode doesn't have health #8825

Closed
m0sth8 opened this issue Aug 27, 2024 · 4 comments
Closed

Server running in worker mode doesn't have health #8825

m0sth8 opened this issue Aug 27, 2024 · 4 comments

Comments

@m0sth8
Copy link

m0sth8 commented Aug 27, 2024

Bug report

Describe the bug

When medusa server is running in workerMode: "worker" it runs http server but doesn't setup health entrypoint.
We use this entrypoint in kubernetes readiness check.

health route is skipped in worker mode in loadEntrypoints method.

Related PR:
#6790

System information

Medusa version (including plugins): v2.0.6-preview
Node.js version: 20
Database: postgres@15
Operating system: alpine linux amd64
Browser (if relevant):

Steps to reproduce the behavior

  1. Run medusa in workerMode: "worker"
  2. Open http://localhost:9010/health/ in browser

Expected behavior

Expected http status 200 OK response, actual response is 404 not found.

Screenshots

If applicable, add screenshots to help explain your problem

Code snippets

If applicable, add code samples to help explain your problem

Additional context

Add any other context about the problem here

@olivermrbl
Copy link
Contributor

This is expected behavior, as worker processes do not load application entry points, including the HTTP layer. You will need to perform your readiness check differently for the worker processes. I am not very familiar with Kubernetes and their readiness probes, so I am not sure what is possible, but perhaps you can instead write a script that opens a (very) short-lived socket connection to the worker process to evaluate its health.

@m0sth8
Copy link
Author

m0sth8 commented Aug 28, 2024

This is expected behavior, as worker processes do not load application entry points, including the HTTP layer. You will need to perform your readiness check differently for the worker processes. I am not very familiar with Kubernetes and their readiness probes, so I am not sure what is possible, but perhaps you can instead write a script that opens a (very) short-lived socket connection to the worker process to evaluate its health.

It's just the whole purpose of the merged PR #6790 was to enable http server to serve health endpoint.
So worker runs http server now but it's useless =)

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@github-actions github-actions bot added the Stale label Sep 28, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

This issue was closed because it has been stalled for 3 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants