Skip to content

Commit

Permalink
addr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
snalli committed Oct 13, 2023
1 parent 33ea5de commit 62e9d16
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
package com.github.ambry.cloud;

import com.github.ambry.config.CloudConfig;
import com.github.ambry.store.Store;
import com.github.ambry.store.StoreErrorCodes;
import com.github.ambry.store.StoreException;
import com.github.ambry.utils.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Callable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -86,9 +93,16 @@ private void throwOrDelay(Throwable e, String actionName, String partitionPath,
vcrMetrics.retryWaitTimeMsec.inc(delay);
} else {
// Either not retryable or exhausted attempts.
// Not very useful to log error here as they are printed in several other places
logger.trace("{} failed partition {} statusCode {} cause {} made {} attempts.", actionName, partitionPath,
statusCode, cause, attempts);
Throwable t = cse.getCause();
Set<StoreErrorCodes> errorCodes = new HashSet<>(Arrays.asList(StoreErrorCodes.Already_Updated));
if (t instanceof StoreException && errorCodes.contains(((StoreException)t).getErrorCode())) {
// Not very useful to log error here as they are printed in several other places
logger.trace("{} failed partition {} statusCode {} cause {} made {} attempts.", actionName, partitionPath,
statusCode, cause, attempts);
} else {
logger.error("{} failed partition {} statusCode {} cause {} made {} attempts.", actionName, partitionPath,
statusCode, cause, attempts);
}
throw cse;
}
} else {
Expand Down

0 comments on commit 62e9d16

Please sign in to comment.