You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In HandleWriteStartState, we do some initial checks, then register a CancellationTokenRegistration, and then do some additional checks on SendState that could throw. If these do throw, then the CancellationTokenRegistration is abandoned and could fire at any time in the future, which is not what we want.
At a minimum we should unregister the CancellationTokenRegistration if an exception occurs here. Better, it would be good to avoid registering it until after we have done the checks that may throw. It's not obvious to me if this is valid to do, though.