Skip to content

Commit

Permalink
Re-balance timeouts to allow communicating with a scheduler to fall b…
Browse files Browse the repository at this point in the history
…ack appropriately.
  • Loading branch information
chmanchester committed Oct 16, 2019
1 parent 3cec94a commit 0cb2e77
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ matrix:
- os: osx

# rustc version compat
- rust: 1.31.1 # oldest supported version, keep in sync with README.md
- rust: 1.31.1
- rust: 1.34.2 # oldest supported version, keep in sync with README.md
- rust: 1.34.2
env: DIST_SCCACHE=1
- rust: beta
- rust: nightly
Expand Down
173 changes: 111 additions & 62 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ openssl = { version = "0.10", optional = true }
rand = "0.5"
redis = { version = "0.9.0", optional = true }
regex = "1"
reqwest = { version = "0.9", optional = true }
reqwest = { version = "0.9.11", optional = true }
retry = "0.4.0"
ring = "0.13.2"
rust-crypto = { version = "0.2.36", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Table of Contents (ToC)
Build Requirements
------------------

Sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus `rustc`). sccache currently requires **Rust 1.31.1**.
Sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus `rustc`). sccache currently requires **Rust 1.34.2**.

We recommend you install Rust via [Rustup](https://rustup.rs/). The generated binaries can be built so that they are very [portable](#building-portable-binaries). By default `sccache` supports a local disk cache. To build `sccache` with support for `S3` and/or `Redis` cache backends, add `--features=all` or select a specific feature by passing `s3`, `gcs`, and/or `redis`. Refer the [Cargo Documentation](http://doc.crates.io/manifest.html#the-features-section) for details.

Expand Down
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use crate::errors::*;
pub const DEFAULT_PORT: u16 = 4226;

/// The number of milliseconds to wait for server startup.
const SERVER_STARTUP_TIMEOUT_MS: u32 = 5000;
const SERVER_STARTUP_TIMEOUT_MS: u32 = 10000;

/// Get the port on which the server should listen.
fn get_port() -> u16 {
Expand Down
4 changes: 4 additions & 0 deletions src/dist/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ mod client {
use crate::errors::*;

const REQUEST_TIMEOUT_SECS: u64 = 600;
const CONNECT_TIMEOUT_SECS: u64 = 5;

pub struct Client {
auth_token: String,
Expand All @@ -1072,12 +1073,15 @@ mod client {
auth_token: String,
) -> Result<Self> {
let timeout = Duration::new(REQUEST_TIMEOUT_SECS, 0);
let connect_timeout = Duration::new(CONNECT_TIMEOUT_SECS, 0);
let client = reqwest::ClientBuilder::new()
.timeout(timeout)
.connect_timeout(connect_timeout)
.build()
.chain_err(|| "failed to create a HTTP client")?;
let client_async = reqwest::r#async::ClientBuilder::new()
.timeout(timeout)
.connect_timeout(connect_timeout)
.build()
.chain_err(|| "failed to create an async HTTP client")?;
let client_toolchains =
Expand Down

0 comments on commit 0cb2e77

Please sign in to comment.