-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Dispose CTS when the Stream is claimed or timeout occurs #59652
base: main
Are you sure you want to change the base?
Conversation
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
{ | ||
// If by now the stream hasn't been claimed for sending, stop tracking it | ||
if (_pendingDotNetToJSStreams.TryRemove(streamId, out var timedOutStream) && !timedOutStream.LeaveOpen) | ||
if (_pendingDotNetToJSStreams.TryRemove(streamId, out var timedOutCancelableStreamReference)) |
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.
the existing code appears to prefer to check LeaveOpen and dispose the stream directly rather than just calling Dispose (which does the same check). I'm not familiar with the history but is there a guiding style principle here @javiercn
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.
Thank you very much for the contribution. The changes look correct to me but I'll let others more familiar with the code do the final approval.
Dispose CTS when the Stream is claimed or timeout occurs
Summary of the changes (Less than 80 chars)
Description
Store the
CancellationTokenSource
to dispose when theDotNetStreamReference
is claimed or timeout occurs.Fixes #59263