Give a remote discard the time an accept gets - #816
Merged
Conversation
Discard and DiscardAll used ViewerClient.ShortTimeout, which is 500ms and exists for calls on a clock - the tray's scan timer, where waiting the full timeout would let callbacks outlast their own period. Discarding is not one of those: it comes from the menu or a hot key, and it no longer runs on the UI thread. Meanwhile the owner answering it may be inside InlineApplier, which waits up to ten seconds on its cross process mutex. So half a second turned a busy owner into "The snapshot viewer is not running." for a single discard. DiscardAll was worse, because its result was dropped. Tracker.Clear emptied its own snapshot list regardless, so "Discard (n)" reported success while the owner had never received the message - and everything reappeared on the next scan two seconds later. It now returns the outcome, and Clear only forgets what it holds when the owner confirms. Both wait on acceptWait, the same fifteen seconds an accept gets, for the same reason.
This was referenced Aug 26, 2026
This was referenced Aug 27, 2026
Closed
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.
Discard and DiscardAll used ViewerClient.ShortTimeout, which is 500ms and exists
for calls on a clock - the tray's scan timer, where waiting the full timeout
would let callbacks outlast their own period. Discarding is not one of those: it
comes from the menu or a hot key, and it no longer runs on the UI thread.
Meanwhile the owner answering it may be inside InlineApplier, which waits up to
ten seconds on its cross process mutex. So half a second turned a busy owner
into "The snapshot viewer is not running." for a single discard.
DiscardAll was worse, because its result was dropped. Tracker.Clear emptied its
own snapshot list regardless, so "Discard (n)" reported success while the owner
had never received the message - and everything reappeared on the next scan two
seconds later. It now returns the outcome, and Clear only forgets what it holds
when the owner confirms.
Both wait on acceptWait, the same fifteen seconds an accept gets, for the same
reason.