-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Feature/storage/stream position deadlock bug #14301
Changes from 7 commits
729b664
712aaec
b2d8717
9585bbc
c1185f9
bf5ab4b
7fa7700
4764e7c
5b68bd3
85b536a
19180b4
7a928b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -716,12 +716,14 @@ internal virtual async Task<Response<BlobContentInfo>> UploadInternal( | |
$"{nameof(conditions)}: {conditions}"); | ||
try | ||
{ | ||
Errors.VerifyStreamPosition(content); | ||
|
||
return await BlobRestClient.BlockBlob.UploadAsync( | ||
ClientDiagnostics, | ||
Pipeline, | ||
Uri, | ||
body: content, | ||
contentLength: content?.Length ?? 0, | ||
contentLength: content?.Length - content?.Position ?? 0, | ||
version: Version.ToVersionString(), | ||
blobContentType: blobHttpHeaders?.ContentType, | ||
blobContentEncoding: blobHttpHeaders?.ContentEncoding, | ||
|
@@ -2190,9 +2192,9 @@ internal static PartitionedUploader<BlobUploadOptions, BlobContentInfo>.Behavior | |
progressHandler, | ||
async, | ||
cancellationToken).ConfigureAwait(false), | ||
CommitPartitionedUpload = async (partitions, args, async, cancellationToken) | ||
CommitPartitionedUpload = async (partitions, initialPosition, args, async, cancellationToken) | ||
=> await client.CommitBlockListInternal( | ||
partitions.Select(partition => StorageExtensions.GenerateBlockId(partition.Offset)), | ||
partitions.Select(partition => StorageExtensions.GenerateBlockId(partition.Offset - initialPosition)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm struggling to wrap my head around this line in particular. Why does the blockId change based on the |
||
args.HttpHeaders, | ||
args.Metadata, | ||
args.Tags, | ||
|
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.
Nit - consider adding explicit parens as most folks aren't as clear on precedence for newer operators like
??
and the interaction with lifted operators.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.
I think I've fixed this everywhere.