Repository navigation
Give the startup and quit device read a 2 s limit - #218
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
cargo test -p eternal-host --lib(1089 passed),cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --check.cargo clippy -p eternal-host --all-targets -- -D warningsexit 0,cargo test -p eternal-host --lib -- vdd(59 passed),Test-VddTask.ps1under Windows PowerShell 5.1.