Skip to content

Make interrupt retry delay methods Linux-only #647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
Merged

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 18, 2025

The get_interrupt_retry_delay and set_interrupt_retry_delay methods in SandboxConfiguration were available on all platforms, but the retry delay value is only used on Linux and not read or written on Windows.

Changes Made

Added #[cfg(target_os = "linux")] attributes to both methods:

  • set_interrupt_retry_delay(&mut self, delay: Duration)
  • get_interrupt_retry_delay(&self) -> Duration

Rationale

  • Linux: Uses signal-based VCPU interruption (LinuxInterruptHandle in kvm.rs and hyperv_linux.rs) where retry delays are necessary due to timing windows when signals may not immediately interrupt the VCPU thread
  • Windows: Uses WHvCancelRunVirtualProcessor (WindowsInterruptHandle in hyperv_windows.rs) which doesn't require retry delays

The struct field interrupt_retry_delay remains present on all platforms to maintain ABI compatibility, but the accessor methods are now properly scoped to Linux only.

Testing

  • All existing tests pass including configuration unit tests
  • The existing Linux-only integration test interrupt_custom_signal_no_and_retry_delay continues to work correctly
  • Code builds successfully and passes all linting checks

Fixes #592.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] get_interrupt_retry_delay and set_interrupt_retry_delay should be Linux only Make interrupt retry delay methods Linux-only Jun 18, 2025
@Copilot Copilot AI requested a review from danbugs June 18, 2025 17:06
Copilot finished work on behalf of danbugs June 18, 2025 17:06
@simongdavies simongdavies added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Jun 18, 2025
@danbugs danbugs marked this pull request as ready for review June 18, 2025 17:38
@danbugs danbugs enabled auto-merge (squash) June 18, 2025 17:44
@danbugs danbugs merged commit 3825444 into main Jun 18, 2025
32 checks passed
@danbugs danbugs deleted the copilot/fix-592 branch June 18, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_interrupt_retry_delay and set_interrupt_retry_delay should be Linux only
4 participants