Commit 04d3960
Fix smart retry for structured message validation to restart from beginning
The issue was that structured messages cannot be decoded from arbitrary offsets - they must be decoded sequentially from the start. When a network interruption occurs during a download with structured message validation, the retry must restart from offset 0, not from the interrupted offset.
Changes to BlobAsyncClientBase:
- Modified retry logic to check if structured message validation is enabled
- When enabled, retries restart from the initial offset (beginning of download)
- When disabled, normal smart retry behavior resumes from interrupted offset
- This fixes "Unexpected segment number" errors that occurred when trying to decode from middle offsets
Changes to tests:
- Updated test assertions to verify all requests start from offset 0 with structured message validation
- Updated test comments to reflect correct behavior (retries restart from beginning)
- Tests now properly validate that structured message downloads succeed despite interruptions
Co-authored-by: gunjansingh-msft <[email protected]>1 parent 4dd559e commit 04d3960
File tree
2 files changed
+42
-27
lines changed- sdk/storage/azure-storage-blob/src
- main/java/com/azure/storage/blob/specialized
- test/java/com/azure/storage/blob/specialized
2 files changed
+42
-27
lines changedLines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | | - | |
| 1392 | + | |
1393 | 1393 | | |
| 1394 | + | |
1394 | 1395 | | |
1395 | | - | |
1396 | | - | |
| 1396 | + | |
| 1397 | + | |
1397 | 1398 | | |
1398 | 1399 | | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
1407 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1408 | 1409 | | |
1409 | 1410 | | |
1410 | | - | |
1411 | | - | |
| 1411 | + | |
1412 | 1412 | | |
1413 | 1413 | | |
1414 | 1414 | | |
| |||
Lines changed: 28 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
280 | 279 | | |
281 | | - | |
282 | | - | |
| 280 | + | |
| 281 | + | |
283 | 282 | | |
284 | 283 | | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
288 | 287 | | |
289 | | - | |
| 288 | + | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
331 | 338 | | |
332 | 339 | | |
333 | 340 | | |
334 | 341 | | |
335 | | - | |
336 | | - | |
| 342 | + | |
| 343 | + | |
337 | 344 | | |
338 | 345 | | |
339 | 346 | | |
| |||
370 | 377 | | |
371 | 378 | | |
372 | 379 | | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
373 | 388 | | |
374 | 389 | | |
0 commit comments