This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Handle internal overflow of the write buffer in WriteAsync by introdu… #2802
Closed
Closed
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cb1db85
Handle internal overflow of the write buffer in WriteAsync by introdu…
tymlipari 17c5fc0
Use cancellation token in FlushWriteAsync
tymlipari 5e05efc
Flush and write operation as helper function instead of using Task.Co…
tymlipari 84a9ce4
Change buffering logic to track flush task activity in order to minim…
tymlipari cfeefdb
Missed case for tracking async flush operations
tymlipari 21da6c0
Respond to code review feedback.
tymlipari 521196b
Fix build break
tymlipari File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Missed case for tracking async flush operations
- Loading branch information
commit cfeefdbb26fe7073cf82bfb0e7b72cbe6bbb44d6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Every time we call FlushWriteAsync, we do these four lines to update _activeBufferOperation. Should they just be moved into FlushWriteAsync? This is the only place where there's the potential for avoiding it, and it's an uncommon case (an async FileStream being finalized with data in the buffer) and a cheap enough operation that the overhead doesn't seem problematic even if it's unnecessary. Worst case, it could be moved into its own helper rather than repeating it each time.
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.
This is just personal preference, so feel free to leave it as-is, but I prefer to write such things as:
That way it's clear that we're always assigning into the field, and the conditional just determines exactly what we're assigning.