Skip to content

Give the startup and quit device read a 2 s limit - #218

Merged
whoisaldo merged 1 commit into
release/0.3.5-candidatefrom
fix/vdd-cm-read-timeout
Nov 8, 2026
Merged

whoisaldo merged 1 commit into
release/0.3.5-candidatefrom
fix/vdd-cm-read-timeout

Conversation

@whoisaldo

Copy link
Copy Markdown
Member

Follow-up to #207. The Disable at startup, at quit and in a panic reads the virtual display's device through Configuration Manager before deciding whether to run the Disable task. That read had no time limit: if it hung, it held the Disable, and every driver request queued behind it, for as long as it hung.

Change

host/src/vdd.rs: the read now runs on its own thread, and the host waits at most 2 s for it (recv_timeout).

Tests

  • vdd::tests::a_device_read_that_hangs_runs_the_disable_task_after_its_limit: a read that blocks; the Disable runs after the 2 s limit. With the read made inline again, as before this change, the test fails with "the Disable waited on a hung device read past its limit".
  • vdd::tests::a_device_read_that_answers_disabled_at_once_keeps_the_skip: a read that answers problem 22 at once runs no task, well within the limit. Other states don't count as disabled.

Runs:

  • macOS: cargo test -p eternal-host --lib (1089 passed), cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check.
  • Windows (native): cargo clippy -p eternal-host --all-targets -- -D warnings exit 0, cargo test -p eternal-host --lib -- vdd (59 passed), Test-VddTask.ps1 under Windows PowerShell 5.1.

The Disable at startup, at quit and in a panic reads the virtual display's device through Configuration Manager before deciding whether to run the task. That read had no limit: one that hung held the Disable, and every request queued behind it, for as long as it hung.

The read now runs on its own thread and is waited on for 2 s. If it doesn't answer in time, the host logs it once and runs the Disable task under the task's own limit; a late answer is dropped. A device that reads disabled in time still runs no task.

Tests: a read that blocks runs the Disable after the limit; a read that answers disabled at once keeps the skip.
@whoisaldo whoisaldo added the 0.3.5 After 0.3.4 label Nov 8, 2026
@whoisaldo
whoisaldo marked this pull request as ready for review November 8, 2026 08:07
@whoisaldo
whoisaldo merged commit 96c6055 into release/0.3.5-candidate Nov 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.3.5 After 0.3.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants