Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Increase preparation timeout (#4270)
Browse files Browse the repository at this point in the history
* Increase preparation-timeout to 60 seconds

* Adapt `pvf_preparation_time` metric to the new value
  • Loading branch information
pepyakin authored Nov 15, 2021
1 parent 12df8e0 commit 414ec0e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 14 additions & 1 deletion node/core/pvf/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,21 @@ impl metrics::Metrics for Metrics {
prometheus::Histogram::with_opts(
prometheus::HistogramOpts::new(
"pvf_preparation_time",
"Time spent in preparing PVF artifacts",
"Time spent in preparing PVF artifacts in seconds",
)
.buckets(vec![
// This is synchronized with COMPILATION_TIMEOUT=60s constant found in
// src/prepare/worker.rs
0.1,
0.5,
1.0,
10.0,
20.0,
30.0,
40.0,
50.0,
60.0,
]),
)?,
registry,
)?,
Expand Down
4 changes: 3 additions & 1 deletion node/core/pvf/src/prepare/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ use std::{sync::Arc, time::Duration};
const NICENESS_BACKGROUND: i32 = 10;
const NICENESS_FOREGROUND: i32 = 0;

const COMPILATION_TIMEOUT: Duration = Duration::from_secs(10);
/// The time period after which the preparation worker is considered unresponsive and will be killed.
// NOTE: If you change this make sure to fix the buckets of `pvf_preparation_time` metric.
const COMPILATION_TIMEOUT: Duration = Duration::from_secs(60);

/// Spawns a new worker with the given program path that acts as the worker and the spawn timeout.
///
Expand Down

0 comments on commit 414ec0e

Please sign in to comment.