Skip to content

Commit 8901ec5

Browse files
authored
Added support to log retries in storage (Azure#18763)
1 parent f28826e commit 8901ec5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sdk/storage/azure-storage-common/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Release History
22

33
## 12.11.0-beta.1 (Unreleased)
4+
- Added support to log retries
45
- Removed a deep copy in PayloadSizeGate
56
- Fixed a bug that would throw if uploading using a stream that returned a number > 0 from available() after the stream had ended
67

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/policy/RequestRetryPolicy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.azure.core.http.HttpPipelineNextPolicy;
1010
import com.azure.core.http.HttpRequest;
1111
import com.azure.core.http.HttpResponse;
12+
import com.azure.core.http.policy.HttpLoggingPolicy;
1213
import com.azure.core.http.policy.HttpPipelinePolicy;
1314
import com.azure.core.util.UrlBuilder;
1415
import reactor.core.publisher.Flux;
@@ -105,6 +106,10 @@ stream, the buffers that were emitted will have already been consumed (their pos
105106
return Mono.error(e);
106107
}
107108
}
109+
/*
110+
Update the RETRY_COUNT_CONTEXT to log retries.
111+
*/
112+
context.setData(HttpLoggingPolicy.RETRY_COUNT_CONTEXT, attempt + 1);
108113

109114
/*
110115
We want to send the request with a given timeout, but we don't want to kickoff that timeout-bound operation

0 commit comments

Comments
 (0)