Skip to content
10 changes: 10 additions & 0 deletions Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ public async Task<PartitionAddressInformation> TryGetAddressesAsync(
partitionKeyRangeIdentity.CollectionRid,
partitionKeyRangeIdentity.PartitionKeyRangeId,
forceRefresh: true)));

refreshAddressesInBackgroundTask.Exception?.Handle(ex =>
{
DefaultTrace.TraceWarning("Failed to refresh addresses in the background for the collection rid: {0} with exception: {1}. '{2}'",
partitionKeyRangeIdentity.CollectionRid,
ex,
System.Diagnostics.Trace.CorrelationManager.ActivityId);

return true;
});
}

return addresses;
Expand Down