Skip to content

Commit de0e028

Browse files
retry period
1 parent 764dad4 commit de0e028

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/Transmission/OtlpExporterPersistentStorageTransmissionHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
using System.Diagnostics;
77
using Google.Protobuf;
8+
using Google.Rpc;
89
using OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ExportClient;
910
using OpenTelemetry.PersistentStorage.Abstractions;
1011
using OpenTelemetry.PersistentStorage.FileSystem;
@@ -160,10 +161,15 @@ private void RetryStoredRequests()
160161
{
161162
var deadlineUtc = DateTime.UtcNow.AddMilliseconds(this.TimeoutMilliseconds);
162163
var request = this.requestFactory.Invoke(data);
163-
if (this.TryRetryRequest(request, deadlineUtc, out var response) || !RetryHelper.ShouldRetryRequest(request, response, OtlpRetry.InitialBackoffMilliseconds, out _))
164+
if (this.TryRetryRequest(request, deadlineUtc, out var response) || !RetryHelper.ShouldRetryRequest(request, response, OtlpRetry.InitialBackoffMilliseconds, out var retryInfo))
164165
{
165166
blob.TryDelete();
166167
}
168+
else
169+
{
170+
// Extend the lease period so that it is retried before the intended retry interval.
171+
blob.TryLease(retryInfo.RetryDelay.Milliseconds);
172+
}
167173
}
168174

169175
fileCount++;

0 commit comments

Comments
 (0)