Skip to content

Commit ee90255

Browse files
authored
[Storage] retry on incomplete XML responses (Azure#13076)
* [Storage] retry on incomplete XML responses When service times out (default max 30s) it terminates the connection but current stable version of `node_fetch` doesn't report error. Instead it returns the incomplete response which leads to XML parse error. It's unlikely that service would send back incomplete response on purpose so it doesn't hurt to treat this error as a `TIMEOUT` error and retry the request. The deserialization policy factory needs to move below retry policy factory so parse error from deserialization can be retried. * Add browser recording for new test * Verify that error has been injected * Tweak comments * Apply same fix to file-share/file-datalake/queue * Also fix an issue in retry logic After changing the order of deserialization policy and retry policy, `error.code` is now populated properly by deserialization policy. This surfaces an issue where an error with code `ResourceNotFound` will also be retried because it contains `eNotFound` and we use `error.code.toString().toUpperCase().includes()` to see if the error is in the list. It passed the check for the network error code `ENOUTFOUND`. This change fixes it by using exact match when checking error code. * Add CHANGELOG entries
1 parent 61bb0c1 commit ee90255

18 files changed

+444
-161
lines changed

sdk/storage/storage-blob/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fixed a compile failure due to "Can't resolve 'crypto'" in Angular. [Issue #13267](https://github.com/Azure/azure-sdk-for-js/issues/13267).
66
- Fixed an error when listing blob with a metadata key of `_` [issue #9197](https://github.com/Azure/azure-sdk-for-js/issues/9171)
7+
- The `"Unclosed root tag"` XML parser error is now retriable. [PR #13076](https://github.com/Azure/azure-sdk-for-js/pull/13076).
78

89
## 12.4.0 (2021-01-12)
910

sdk/storage/storage-blob/recordings/browsers/retrypolicy/recording_retry_policy_should_work_when_on_parse_error_with_unclosed_root_tag.json

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/storage/storage-blob/recordings/node/generation_for_user_delegation_sas_nodejs_only/recording_saoid_and_scid_should_work.js

Lines changed: 53 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)