-
Notifications
You must be signed in to change notification settings - Fork 2k
add probe signals for beat #4760
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements Kubernetes health monitoring for Celery Beat and workers through file-based liveness and readiness probes.
- Added
make_probe_path
incelery_utils.py
to generate standardized probe file paths with hostname validation - Implemented liveness probe in
beat.py
that updates during scheduler ticks and readiness probe after Redis initialization - Added
LivenessProbe
bootstep class inapp_base.py
for periodic worker health checks - Probe files are managed in
/tmp
with proper cleanup on worker shutdown - Consider adding error handling for probe file operations in case of filesystem issues
3 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
hostname: str = cast(str, sender.hostname) | ||
path = _make_probe_path("readiness", hostname) | ||
path = make_probe_path("readiness", hostname) | ||
path.touch() | ||
logger.info(f"Readiness signal touched at {path}.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Similar to liveness probe, readiness probe should handle potential IOErrors when touching the file
hostname: str = cast(str, sender.hostname) | |
path = _make_probe_path("readiness", hostname) | |
path = make_probe_path("readiness", hostname) | |
path.touch() | |
logger.info(f"Readiness signal touched at {path}.") | |
hostname: str = cast(str, sender.hostname) | |
path = make_probe_path("readiness", hostname) | |
try: | |
path.touch() | |
logger.info(f"Readiness signal touched at {path}.") | |
except IOError: | |
logger.exception(f"Failed to create readiness probe file at {path}") |
Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
Description
Fixes https://linear.app/danswer/issue/DAN-2007/k8s-probes-for-celery-beat
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.