-
Notifications
You must be signed in to change notification settings - Fork 803
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
Cancellable: fix leaking cancellation token #18295
Conversation
❗ Release notes required
|
Yes, good catch. Apparently, I forgot how |
Could somebody update the ILVerify baselines, please? |
This is beyond scope of this PR, but it occurred to me now: |
@auduchinok @majocha - can you think of any way to test such things? |
Some of the possibly similar cases are tested in the module reader cancellation tests in this repo. They do catch regressions in PRs like this one (e.g. the transparent compiler changes here) And we also have tests in the Rider plugin. But it's somewhat difficult to come up with test cases for some of the cases, as, for example, this particular case was related to the implementation details of the cancellation token sources handling inside Async.parallel. This particular leak was reliably reproduced in the tests in the Rider plugin, but unfortunately only when run in the product monorepo. I was not able to reproduce it in the plugin repo or find another repro so far :( Good news are there are tests and environments that can catch such things :) |
Something is still wrong, I can repro this error locally
It's somehow happening in |
Yes, now I remember I dealt with it in this experiment: |
Update docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
1074211
to
9c96524
Compare
This is ready 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do! Cancellable.UseToken()
its not used anywhere after this PR, right?
Yes, that's correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Eugene!
The previous implementation could lead to the cancellation leaking to another async, leading to unexpected exceptions about disposed cancellation token source.
Thanks a lot to @ForNeVeR for the help with the investigation!
cc @majocha