Uh oh!
There was an error while loading. Please reload this page.
Cancellable: fix leaking cancellation token - #18295
Conversation
❗ Release notes required
|
majocha
commented
Feb 6, 2025
Yes, good catch. Apparently, I forgot how |
auduchinok
commented
Feb 6, 2025
Could somebody update the ILVerify baselines, please? |
ForNeVeR
commented
Feb 6, 2025
This is beyond scope of this PR, but it occurred to me now: |
Uh oh!
There was an error while loading. Please reload this page.
psfinaki
commented
Feb 7, 2025
@auduchinok@majocha - can you think of any way to test such things? |
auduchinok
commented
Feb 7, 2025
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: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Update docs/release-notes/.FSharp.Compiler.Service/9.0.300.md
1074211 to
9c96524Compareauduchinok
commented
Feb 10, 2025
This is ready 🙂 |
T-Gro
left a comment
There was a problem hiding this comment.
do! Cancellable.UseToken() its not used anywhere after this PR, right?
auduchinok
commented
Feb 11, 2025
Yes, that's correct |
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