Skip to content

Enforce Firecracker runtime timeout via host watchdog and clarify limit semantics - #16

Merged
dev-dami merged 3 commits into
masterfrom
copilot/trace-timeoutms-memorymb-cpulimit
Aug 2, 2026
Merged

Enforce Firecracker runtime timeout via host watchdog and clarify limit semantics#16
dev-dami merged 3 commits into
masterfrom
copilot/trace-timeoutms-memorymb-cpulimit

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

timeoutMs was only applied to the initial VSOCK connect path, leaving post-connect guest execution able to block indefinitely. This change closes that gap while preserving existing memoryMb/cpuLimit wiring to Firecracker machine-config.

  • Execution timeout enforcement (host-side watchdog)

    • Added bounded VSOCK frame reads in FirecrackerOrchestrator::wait_and_teardown.
    • Applied a rolling read timeout plus absolute elapsed-time check against timeoutMs.
    • On timeout, host now force-terminates the Firecracker process and returns an execution-timeout error.
  • Failure semantics

    • Differentiated disconnect (UnexpectedEof) from watchdog timeout (TimedOut) during stream processing.
    • Kept teardown behavior centralized through existing cleanup paths.
  • Documentation clarity (limit ownership)

    • Updated docs to explicitly state:
      • memoryMb and cpuLimit map to Firecracker machine-config.
      • timeoutMs is enforced by a host watchdog during runtime execution.
stream.set_read_timeout(Some(Duration::from_millis(IO_POLL_TIMEOUT_MS)))?;

if start_time.elapsed().as_millis() > (timeout_ms as u128) {
    return Err(std::io::Error::new(
        std::io::ErrorKind::TimedOut,
        "Execution timed out",
    ));
}

Copilot AI changed the title fix: enforce Firecracker execution timeout watchdog Enforce Firecracker runtime timeout via host watchdog and clarify limit semantics Aug 2, 2026
Copilot AI requested a review from dev-dami August 2, 2026 18:53
Copilot AI requested a review from dev-dami August 2, 2026 19:02
@dev-dami
dev-dami marked this pull request as ready for review August 2, 2026 19:04
@dev-dami
dev-dami merged commit ab777f2 into master Aug 2, 2026
4 checks passed
@dev-dami
dev-dami deleted the copilot/trace-timeoutms-memorymb-cpulimit branch August 2, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants