1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Internal tunables for the cdb session actor.
//!
//! Centralised so that we can adjust them in one place and test against
//! known values, instead of having `16 * 1024`, `4096`, `50ms` and friends
//! scattered across the actor.
use Duration;
/// Bytes of buffered stdout/stderr inspected when looking for the next
/// prompt or for end-of-stream context.
pub const PROMPT_TAIL_BYTES: usize = 16 * 1024;
/// Bytes of buffered output reported in the "cdb exited" diagnostic.
pub const EXIT_TAIL_BYTES: usize = 8 * 1024;
/// Read buffer used by the stdout/stderr forwarder tasks.
pub const STREAM_READ_BUF_BYTES: usize = 4096;
/// Polling interval for `Session::wait_ready` when waiting for the next
/// prompt.
pub const WAIT_READY_POLL: Duration = from_millis;
/// Periodic tick used by the actor's `select!` loop to detect callers
/// dropping their command future.
pub const ACTOR_CANCEL_TICK: Duration = from_millis;
/// Fallback pseudo-deadline when no per-command deadline is set. Kept
/// large because the actor's `select!` arm uses it as a "no timeout"
/// stand-in.
pub const ACTOR_IDLE_BLOCK: Duration = from_secs;
/// Maximum time we wait for the cdb child to exit after a `Stop` request
/// before falling back to a forced kill.
pub const STOP_WAIT: Duration = from_secs;
/// Maximum time `SessionManager::shutdown` waits for an individual
/// session to terminate.
pub const SHUTDOWN_PER_SESSION: Duration = from_secs;