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
Remove duplicate byte skipping logic - use simpler approach
Reverted to simpler implementation that doesn't try to skip duplicate bytes. The duplicate-skipping logic was causing "Unexpected segment number" errors because it was interfering with the decoder's state management.
The correct approach:
1. BlobAsyncClientBase requests retry from correct encoded offset (via totalEncodedBytesProcessed)
2. Server sends bytes starting from that offset (no duplicates)
3. Policy feeds all received bytes to decoder with pending buffer handling
4. Decoder maintains state and processes bytes sequentially
Removed:
- getResponseStartOffset() method
- currentResponseStartOffset and currentResponseBytesRead fields from DecoderState
- Duplicate byte detection and skipping logic in decodeStream()
This simpler approach relies on correct offset calculation in the retry logic (which we have) rather than trying to detect and skip duplicates at the policy level.
Addresses comment #2499104452 - investigating test failures.
Co-authored-by: gunjansingh-msft <[email protected]>
Copy file name to clipboardExpand all lines: sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/policy/StorageContentValidationDecoderPolicy.java
+5-72Lines changed: 5 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -63,10 +63,6 @@ public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineN
0 commit comments