Skip to content

feat: use /status over /state for checking liveness#533

Merged
ChaoticTempest merged 4 commits intodevelopfrom
phuong/feat/status-over-state
Sep 26, 2025
Merged

feat: use /status over /state for checking liveness#533
ChaoticTempest merged 4 commits intodevelopfrom
phuong/feat/status-over-state

Conversation

@ChaoticTempest
Copy link
Copy Markdown
Contributor

This utilizes a new endpoint called /status to check for liveness. /state makes use of 4 different calls to redis which can be slow if we have too many calls to redis at the same time. This could be the case when we're generating a ton of triples and presignatures and there's many writes to it, with congestion to the redis connection pool.

/status does none of these redis calls and purely checks the current protocol state (i.e. Running, Resharing, Generating, ...).

Should wait until #532 gets merged first to see an improvement in our web endpoint metrics

#[tracing::instrument(level = "debug", skip_all)]
async fn status(Extension(web): Extension<Arc<AxumState>>) -> Json<StateStatus> {
let status = match web.node.status() {
NodeStatus::Started | NodeStatus::Starting => StateStatus::NotRunning,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's reuse the existing NodeStatus enum type. The difference is only in the naming of a single field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this, otherwise lgtm

ppca
ppca previously approved these changes Sep 22, 2025
#[tracing::instrument(level = "debug", skip_all)]
async fn status(Extension(web): Extension<Arc<AxumState>>) -> Json<StateStatus> {
let status = match web.node.status() {
NodeStatus::Started | NodeStatus::Starting => StateStatus::NotRunning,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this, otherwise lgtm

jakmeier
jakmeier previously approved these changes Sep 25, 2025
Co-authored-by: Jakob Meier <inbox@jakobmeier.ch>
@ChaoticTempest ChaoticTempest merged commit 13fb053 into develop Sep 26, 2025
3 checks passed
@ChaoticTempest ChaoticTempest deleted the phuong/feat/status-over-state branch September 26, 2025 18:47
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

Successfully merging this pull request may close these issues.

4 participants