Skip to content

Commit 6c9de26

Browse files
fix(prover): Fixing shutdown time for circuit-prover (matter-labs#3768)
## What ❔ Fixed shutdown time for circuit-prover. Metrics didn't allow circuit-prover to exit properly on SIGTERM <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ Circuit-prover was waiting for GRACEFUL_SHUTDOWN_TIME timeout regardless whether it had jobs or not. Metrics didn't exit properly. <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.
1 parent bdbbaaa commit 6c9de26

File tree

1 file changed

+2
-5
lines changed
  • prover/crates/bin/circuit_prover/src

1 file changed

+2
-5
lines changed

prover/crates/bin/circuit_prover/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,11 @@ async fn main() -> anyhow::Result<()> {
141141
}
142142
}
143143
let shutdown_time = Instant::now();
144-
tasks.complete(GRACEFUL_SHUTDOWN_DURATION).await;
145-
PROVER_BINARY_METRICS
146-
.shutdown_time
147-
.observe(shutdown_time.elapsed());
148-
PROVER_BINARY_METRICS.run_time.observe(start_time.elapsed());
149144
metrics_stop_sender
150145
.send(true)
151146
.context("failed to stop metrics")?;
147+
tasks.complete(GRACEFUL_SHUTDOWN_DURATION).await;
148+
tracing::info!("Tasks completed in {:?}.", shutdown_time.elapsed());
152149
Ok(())
153150
}
154151
/// Loads configs necessary for proving.

0 commit comments

Comments
 (0)