Skip to content

feat: add support for epoch-based deadline extensions for host I/O#138

Merged
ruslanti merged 2 commits into
mainfrom
ref/stop-exec-timer-while-doing-exteral-http-request
May 13, 2026
Merged

feat: add support for epoch-based deadline extensions for host I/O#138
ruslanti merged 2 commits into
mainfrom
ref/stop-exec-timer-while-doing-exteral-http-request

Conversation

@ruslanti
Copy link
Copy Markdown
Collaborator

  • Introduced epoch_pause_ms to track elapsed host I/O time and extend execution deadlines.
  • Enhanced StoreBuilder with epoch_pause_ms and max_external_duration_ms configuration.
  • Updated HTTP backends to deposit I/O time into shared counters and refund guest execution ticks.
  • Integrated epoch_deadline_callback for dynamic deadline adjustments.

Copilot AI review requested due to automatic review settings May 12, 2026 06:42
- Introduced `epoch_pause_ms` to track elapsed host I/O time and extend execution deadlines.
- Enhanced `StoreBuilder` with `epoch_pause_ms` and `max_external_duration_ms` configuration.
- Updated HTTP backends to deposit I/O time into shared counters and refund guest execution ticks.
- Integrated `epoch_deadline_callback` for dynamic deadline adjustments.
@ruslanti ruslanti force-pushed the ref/stop-exec-timer-while-doing-exteral-http-request branch from 78c93eb to a8457cb Compare May 12, 2026 06:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces epoch-based deadline extensions by tracking wall-clock time spent in host I/O (notably outbound HTTP) and using that “credit” to extend Wasmtime epoch deadlines, while also adding configurable slack to the outer Tokio timeout.

Changes:

  • Added a shared epoch_pause_ms counter to store state and integrated a epoch_deadline_callback to extend deadlines based on accumulated host I/O time.
  • Wired HTTP execution paths/backends to deposit elapsed outbound HTTP time (ms) into epoch_pause_ms.
  • Expanded tracing context on request handling and ensured spawned tasks inherit the current tracing span.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/runtime/src/store.rs Adds epoch pause counter plumbing, max external duration slack, and installs an epoch deadline callback to extend/trap dynamically.
crates/runtime/src/lib.rs Stores the shared counter on Data and deposits wasi-http outbound request wall time into it.
crates/http-service/src/lib.rs Adds an extra span field for request handling tracing.
crates/http-service/src/executor/wasi_http.rs Wires a shared epoch pause counter into the store builder and backend; instruments spawned task with current span.
crates/http-service/src/executor/http.rs Wires a shared epoch pause counter into the store builder and backend for the non-wasi-http executor path.
crates/http-backend/src/lib.rs Deposits outbound HTTP wall time (request + body read) into the shared epoch pause counter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/runtime/src/store.rs
Comment thread crates/runtime/src/store.rs Outdated
Comment thread crates/runtime/src/store.rs Outdated
Comment thread crates/http-service/src/executor/http.rs
@ruslanti ruslanti requested a review from Copilot May 12, 2026 12:58
@ruslanti ruslanti self-assigned this May 12, 2026
@ruslanti ruslanti added the enhancement New feature or request label May 12, 2026
@ruslanti ruslanti marked this pull request as ready for review May 12, 2026 12:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Comment thread crates/runtime/src/store.rs
Comment thread crates/runtime/src/store.rs
@ruslanti ruslanti requested a review from qrdl May 13, 2026 06:23
@ruslanti ruslanti force-pushed the ref/stop-exec-timer-while-doing-exteral-http-request branch from fef1e79 to 05a01f7 Compare May 13, 2026 07:04
@ruslanti ruslanti merged commit 5553654 into main May 13, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants