Skip to content

Wait for Discovery to initialize before Cancelling it#5177

Merged
nohwnd merged 1 commit into
microsoft:mainfrom
nohwnd:wait-for-discovery-to-init
Aug 13, 2024
Merged

Wait for Discovery to initialize before Cancelling it#5177
nohwnd merged 1 commit into
microsoft:mainfrom
nohwnd:wait-for-discovery-to-init

Conversation

@nohwnd

@nohwnd nohwnd commented Aug 12, 2024

Copy link
Copy Markdown
Member

Description

Because discovery intialization takes time until the populates the _currentDiscoveryRequest, and any call to CancelDiscovery in the meantime would just return, we block until the request is populated, and then cancel. This is workaround for race condition that happens when you issue Discovery and DiscoveryCancel quickly in succession.

Related issue

Fix https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1579525

@MarcoRossignoli MarcoRossignoli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we can have a test but looks complex, I got the idea

@nohwnd

nohwnd commented Aug 13, 2024

Copy link
Copy Markdown
Member Author

I tested it via vstest console wrapper so test is possible, but it is quite flaky, so I would rather avoid it.

@nohwnd nohwnd merged commit 80af388 into microsoft:main Aug 13, 2024
This was referenced Jul 21, 2025
This was referenced Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants