Commit ee90255
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 entries1 parent 61bb0c1 commit ee90255
File tree
18 files changed
+444
-161
lines changed- sdk/storage
- storage-blob
- recordings
- browsers/retrypolicy
- node
- generation_for_user_delegation_sas_nodejs_only
- retrypolicy
- src
- policies
- test
- storage-file-datalake
- src
- policies
- storage-queue
- src
- policies
18 files changed
+444
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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