Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition in sendRequest in jsonrpc #1474

Closed
9at8 opened this issue May 17, 2024 · 1 comment · Fixed by #1481
Closed

Race condition in sendRequest in jsonrpc #1474

9at8 opened this issue May 17, 2024 · 1 comment · Fixed by #1481
Milestone

Comments

@9at8
Copy link
Member

9at8 commented May 17, 2024

await messageWriter.write(requestMessage);
responsePromises.set(id, responsePromise);

In the code linked above, if a response is handled before we get a chance to set the responsePromise on the next line, we will never resolve the request.

The fix should be to set the responsePromise before we await on the message write.

@dbaeumer
Copy link
Member

Thanks for the issue and the PR. Release vscode-jsonrpc@8.2.1.

Let me know how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants