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
Implement proper smart retry using encoded byte offset for structured messages
Changed the retry logic to use the encoded byte offset from the decoder state instead of restarting from the beginning. This enables true smart retry where downloads resume from the interrupted encoded offset.
Changes:
- Modified BlobAsyncClientBase to extract the encoded offset from DecoderState
- On retry, request range starts from the encoded offset (totalEncodedBytesProcessed)
- Decoder state is preserved across retries to maintain validation state
- Updated test assertions to verify smart retry behavior (resume from encoded offset)
- Updated test comments to reflect correct smart retry behavior
Note: This implementation resumes from the encoded offset where the interruption occurred. The decoder will need to handle resuming from mid-stream data, which may require additional enhancements to support arbitrary offset resumption within structured message segments.
Co-authored-by: gunjansingh-msft <[email protected]>
Copy file name to clipboardExpand all lines: sdk/storage/azure-storage-blob/src/test/java/com/azure/storage/blob/specialized/BlobMessageDecoderDownloadTests.java
+22-17Lines changed: 22 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -228,8 +228,7 @@ public void downloadStreamWithResponseContentValidationSmartRetry() throws IOExc
228
228
// Test smart retry functionality with structured message validation
229
229
// This test simulates network interruptions and verifies that:
230
230
// 1. The decoder validates checksums for all received data
231
-
// 2. Retries restart from the beginning (offset 0) since structured messages
232
-
// cannot be decoded from arbitrary offsets
231
+
// 2. Retries resume from the encoded offset where the interruption occurred
233
232
// 3. The download eventually succeeds despite multiple interruptions
0 commit comments