Skip to content

Fix issue where RemoteServiceInvoker never initializes (17.12)#11525

Merged
phil-allen-msft merged 1 commit intodotnet:release/dev17.12from
davidwengier:BackportRemoteServiceInvoker12
Feb 21, 2025
Merged

Fix issue where RemoteServiceInvoker never initializes (17.12)#11525
phil-allen-msft merged 1 commit intodotnet:release/dev17.12from
davidwengier:BackportRemoteServiceInvoker12

Conversation

@davidwengier
Copy link
Copy Markdown
Member

Backport of #11430 to 17.13

The first time that a remote service call is made by RemoteServiceInvoker, it calls into Roslyn OOP to initialize itself. However, the CancellationToken that's passed for initialization is the same one that is passed by the original service caller. If that token is cancelled by the caller during initialization, RemoteServiceInvoker will get stuck and never actually make a remote service call because the initialization task will forever be in a cancelled state.

The fix for this issue is to make RemoteServiceInvoker disposable, and add a CancellationTokenSource that is cancelled when the invoker itself is dispose. Then, pass that CancellationTokenSource's token to initialization.
@phil-allen-msft phil-allen-msft changed the title Fix issue where RemoteServiceInvoker never initializes Fix issue where RemoteServiceInvoker never initializes (17.12) Feb 21, 2025
@phil-allen-msft phil-allen-msft merged commit d0fbb07 into dotnet:release/dev17.12 Feb 21, 2025
15 of 17 checks passed
@davidwengier davidwengier deleted the BackportRemoteServiceInvoker12 branch May 2, 2025 07:34
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.

3 participants