Skip to content

Commit

Permalink
feat: Make timeout for downloading configurable (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
loewenheim authored Jul 6, 2021
1 parent 37705df commit 7cf7265
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Update symbolic to write versioned CFI Caches, and fix SymCache conversion related to inline-parent offset. ([#470](https://github.com/getsentry/symbolicator/pull/470))
- Update symbolic to allow processing PDB files with broken inlinee records. ([#477](https://github.com/getsentry/symbolicator/pull/477))
- Update symbolic to correctly apply bcsymbolmaps to symbol and filenames coming from DWARF. ([#479](https://github.com/getsentry/symbolicator/pull/479))
- Make the timeout for downloading files configurable. ([#482](https://github.com/getsentry/symbolicator/pull/482))

### Tools

Expand Down
5 changes: 5 additions & 0 deletions crates/symbolicator/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ pub struct Config {

/// Number of subprocesses in the internal processing pool.
pub processing_pool_size: usize,

/// The timeout for downloads.
#[serde(with = "humantime_serde")]
pub download_timeout: Duration,
}

impl Config {
Expand Down Expand Up @@ -305,6 +309,7 @@ impl Default for Config {
sources: Arc::from(vec![]),
connect_to_reserved_ips: false,
processing_pool_size: num_cpus::get(),
download_timeout: Duration::from_secs(300),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/symbolicator/src/services/download/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl DownloadService {
// See: https://docs.rs/tokio/1.0.1/tokio/runtime/struct.Runtime.html#method.enter
let _guard = self.worker.enter();
let job = slf.dispatch_download(source, destination).bind_hub(hub);
let job = tokio::time::timeout(Duration::from_secs(300), job);
let job = tokio::time::timeout(self.config.download_timeout, job);
let job = measure("service.download", m::timed_result, job);

// Map all SpawnError variants into DownloadError::Canceled.
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ metrics:
sources. See [Security](#security). Defaults to `false`.
- `processing_pool_size`: The number of subprocesses in Symbolicator's internal
processing pool. Defaults to the total number of logical CPUs on the machine.
- `download_timeout`: The timeout for downloading debug files.
- `caches`: Fine-tune cache expiry.
All time units can be either a time expression like `1s`. Units
can be `s`, `seconds`, `m`, `minutes`, `h`, `hours`, `d`, `days`,
Expand Down

0 comments on commit 7cf7265

Please sign in to comment.