Skip to content

Commit

Permalink
fix(prover): Do not exit on missing watcher data. (#3119)
Browse files Browse the repository at this point in the history
## What ❔

Do not exit on missing watcher data.
<!-- 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 ❔

To fix always exiting in `scaler_period` after start due to missing
data.

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] 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.
- [x] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

ref ZKD-1855
  • Loading branch information
yorik authored Oct 17, 2024
1 parent 18ae3f9 commit 76ed6d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion prover/crates/bin/prover_autoscaler/src/global/scaler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ impl Task for Scaler {
let queue = self.queuer.get_queue().await.unwrap();

let guard = self.watcher.data.lock().await;
watcher::check_is_ready(&guard.is_ready)?;
if let Err(err) = watcher::check_is_ready(&guard.is_ready) {
tracing::warn!("Skipping Scaler run: {}", err);
return Ok(());
}

for (ns, ppv) in &self.namespaces {
let q = queue.queue.get(ppv).cloned().unwrap_or(0);
Expand Down

0 comments on commit 76ed6d9

Please sign in to comment.