httpcore
httpcore copied to clipboard
Remove shielding from cancellation process.
For handling async-cancellations we're currently shielding close
operations, in order to ensure we don't end up with a connection in an inconsistent state when cancellations are used.
A better approach is to ensure that the state changes for this case are handled synchronously (so that cancellations won't propagate into those). While the network close remains unshielded async (it's okay for cancellations to propagate into those).
Reasoning about the state when cancellations occur is a bit fiddly, tho I think we can apply this same style of approach all the way through to remove the need for async cancellation-shielding. (Closing state is applied first synchronously. Network close operations are then attempted, and may propagate cancellation.)
Refs #922