Repository navigation
fix(claims): settle a hold before it drains, and skip headless gamescope - #358
Merged
Merged
Conversation
A hold claim drained the holder the moment its process appeared. A screenshot script that ran `gamescope --backend headless` for five seconds took the card from a serving engine five times in one day, and when the helper exited the claim was canceled with the card already down (#337). - `settle = "5s"` on a hold waits for the match to last that long before it drains anyone. The clock restarts if the process goes away. Default 0 keeps today's behavior, so only rules that ask for it wait. - The built-in gamescope rule ignores `--backend headless`, the way a capture or CI harness runs it. Tests: TestBuiltinGamescopeSkipsHeadless fails on the old rule, where both gamescopes matched; TestWatcherHoldSettles covers the wait and the clock restart; TestCompileRejectsSettleOnTrack refuses a settle on a rule that drains nothing.
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.
Stops the drain in #337.
A hold claim starts on the first scan that matches, so a short-lived helper drains the holder and then ends. On the machine where it was reported, a screenshot script ran
gamescope --backend headlessfor about five seconds per frame and drained a foreground Strata lease five times in one day. When the helper exited, the claim was canceled with the card already down.What changed
settle = "5s"on a[[claim]]hold: the matched process must last that long before the hold starts. The clock restarts when the process goes away. The default 0 keeps the current behavior.--backend headless, the way a capture or CI harness runs it.Proof
TestBuiltinGamescopeSkipsHeadlessfails on the old rule, where both gamescopes matched.TestWatcherHoldSettlescovers the wait and the clock restart after a gap.TestCompileRejectsSettleOnTrackrefuses a settle on a rule that drains nothing.Not fixed
A claim that ends after its grant still leaves the card with the claim's lease released, not back with the drained engine. Restoring a stopped engine is outside what berthd does, so this change prevents the drain instead of reversing it.
Refs #337.