nextcloud / nextcloud/notify_push

feature request: Health check endpoint(s)

Open
#324 2 comments 25 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
344
Forks
64
Avg merge
2d 10h
Merged PRs (30d)
5

Description

I'm deploying this in kubernetes and it would be helpful to have a health endpoint of some kind that I can use which will inform when the daemon is up and ready to go -- databases connected, etc.


stretch goal: This is probably more than you want to deal with, but best practices for kubernetes would indicate that it should also start returning a non-success code as soon as a SIGINT is detected but current requests should get handled before shutting down. the flow would be like this:

  • Startup: "ready" check fails
  • After DB and redis connections "ready" check succeeds
  • On SIGINT "ready" check starts failing again but connections are still accepted.
  • After some arbitrary timeout no new connections are accepted (this should be the interval that kubernetes checks the ready endpoint)
  • Once all connections are handled or some additional arbitrary timeout expires the process exits

The goal with that flow is that kubernetes will stop serving traffic to a pod as soon as it it sees that it has stoped returning "ready". Thus with this flow existing connections will be handled while new connections will go to a new instance of the pod, making for a seemless changeover to a new pod version.


As I said, that's a "this would be neat to move towards enterprise class stuff" but even if you can just give me a simple "yep we're up and ready to go" check that would be super handy =] Right now I'm using the metrics port -- showing it as ready as soon as it responds there -- but that's not a guarantee that it's actually up.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the daemon's startup, metrics-port, database/Redis connection, request-handling, and SIGINT shutdown entry points; then determine where a readiness endpoint can reflect connection state and graceful shutdown. Done means Kubernetes can distinguish startup, ready, draining, and stopped states without interrupting current requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, redis, rust
Domain
api, backend, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.