Skip to content

[metrics] HTTP server task spawned with discarded JoinHandle — silent death masks bot health #222

@obchain

Description

@obchain

Refs #50

File: crates/charon-cli/src/main.rs (metrics task spawn)

Problem

The Prometheus HTTP server is spawned with tokio::spawn and the JoinHandle is dropped. If the server task panics or returns Err, no notification fires, no shutdown is triggered, scrapes silently start failing. Operator dashboards go dark while the bot continues running — looks like alert silence, actually data blackout.

Same pattern as PR #32 #173 (BlockListener) and PR #42 #173.

Fix

Use the existing JoinSet supervise() in main.rs. On metrics task completion (panic or unexpected Ok), log error! and trigger controlled shutdown so the operator sees explicit failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishstatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions