Allow html requests to be properly cancelled #11829
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #11759
I'm not honestly sure what I was thinking in not passing on the cancellation token. The idea of "well we might need this work later, lets run it in the background" might have made some sense (though likely not, as Roslyn essentially does the same sort of thing with its compilation tracker) but since none of the tasks here are fire and forget, nor do we want them to be, there was never any real cancellation.
It's purely anecdotal, but this seems to have fixed (or at least reduced) the amount of cancellation happening (and erroneously logged errors due to cancellation), I think because new requests would come in (or things might have been timing out) after old requests were cancelled by the client, but of course we never honoured that.