Skip to content

Commit

Permalink
Pass in clean blob id into router.ttlUpdate (#2912)
Browse files Browse the repository at this point in the history
Co-authored-by: Sophie Guo <sopguo@sopguo-mn2.linkedin.biz>
  • Loading branch information
SophieGuo410 and Sophie Guo authored Oct 4, 2024
1 parent a546a59 commit cb39e67
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ private Callback<String> routerPutBlobCallback(BlobInfo blobInfo) {
return buildCallback(frontendMetrics.putRouterPutBlobMetrics, blobId -> {
restResponseChannel.setHeader(RestUtils.Headers.BLOB_SIZE, restRequest.getBlobBytesReceived());
restResponseChannel.setHeader(RestUtils.Headers.LOCATION, blobId);
String blobIdClean = RestUtils.stripSlashAndExtensionFromId(blobId);
if (blobInfo.getBlobProperties().getTimeToLiveInSeconds() == Utils.Infinite_Time) {
// Do ttl update with retryExecutor. Use the blob ID returned from the router instead of the converted ID
// since the converted ID may be changed by the ID converter.
String serviceId = blobInfo.getBlobProperties().getServiceId();
retryExecutor.runWithRetries(retryPolicy,
callback -> router.updateBlobTtl(restRequest, blobId, serviceId, Utils.Infinite_Time, callback,
callback -> router.updateBlobTtl(restRequest, blobIdClean, serviceId, Utils.Infinite_Time, callback,
QuotaUtils.buildQuotaChargeCallback(restRequest, quotaManager, false)),
this::isRetriable, routerTtlUpdateCallback(blobInfo));
} else {
Expand Down

0 comments on commit cb39e67

Please sign in to comment.