public static bool AlwaysRetry(this RetryReason reason) { return(reason == RetryReason.KvNotMyVBucket || reason == RetryReason.ScopeNotFound || reason == RetryReason.CollectionNotFound || reason == RetryReason.ViewsNoActivePartition || reason == RetryReason.CircuitBreakerOpen); }
public RetryAction RetryAfter(IOperation operation, RetryReason reason) { if (operation.Idempotent || reason.AllowsNonIdempotentRetries()) { var backoffDuration = _backoffCalculator.CalculateBackoff(operation); return(RetryAction.WithDuration(backoffDuration)); } return(RetryAction.WithDuration(null)); }
public RetryAction RetryAfter(IRequest request, RetryReason reason) { if (request.Idempotent || reason.AllowsNonIdempotentRetries()) { var backoffDuration = _backoffCalculator.CalculateBackoff(request); return(RetryAction.Duration(backoffDuration)); } return(RetryAction.Duration(null)); }
/// <summary> /// Is retryable failure due to Detours /// </summary> public static bool IsDetoursRetrableFailure(this RetryReason retryReason) { switch (retryReason) { case RetryReason.MismatchedMessageCount: case RetryReason.OutputWithNoFileAccessFailed: return(true); } return(false); }
/// <summary> /// Is retryable failure during the pre process execution. /// </summary> public static bool IsPreProcessExecRetryableFailure(this RetryReason retryReason) { switch (retryReason) { case RetryReason.ProcessStartFailure: case RetryReason.TempDirectoryCleanupFailure: return(true); default: return(false); } }
/// <summary> /// Returns a RetryInfo object with the default location for the given RetryReason. /// </summary> public static RetryInfo GetDefault(RetryReason reason) { switch (reason) { case RetryReason.ResourceExhaustion: case RetryReason.ProcessStartFailure: case RetryReason.TempDirectoryCleanupFailure: case RetryReason.StoppedWorker: return(RetryOnDifferentWorker(reason)); case RetryReason.OutputWithNoFileAccessFailed: case RetryReason.MismatchedMessageCount: case RetryReason.AzureWatsonExitCode: case RetryReason.UserSpecifiedExitCode: return(RetryOnSameWorker(reason)); case RetryReason.VmExecutionError: return(RetryOnSameAndDifferentWorkers(reason)); default: throw Contract.AssertFailure("Default not defined for RetryReason: " + reason.ToString()); } }
public static bool AlwaysRetry(this RetryReason reason) { return(reason == RetryReason.KvNotMyVBucket || reason == RetryReason.KvCollectionOutdated || reason == RetryReason.ViewsNoActivePartition); }
public static bool AllowsNonIdempotentRetries(this RetryReason reason) { return(!(reason == RetryReason.Unknown || reason == RetryReason.SocketClosedWhileInFlight)); }
/// <summary> /// Returns a RetryInfo object to be retried on the Same Worker first, and retried on another worker of it fails again /// </summary> private static RetryInfo RetryOnSameAndDifferentWorkers(RetryReason retryReason) { return(new RetryInfo(retryReason, RetryLocation.Both)); }
/// <summary> /// Returns a RetryInfo object to be retried on a Different Worker /// </summary> private static RetryInfo RetryOnDifferentWorker(RetryReason retryReason) { return(new RetryInfo(retryReason, RetryLocation.DifferentWorker)); }
public static extern void BIO_set_retry_reason(BIO a, RetryReason ptr);
private partial void LogRetryQuery(string clientContextId, Redacted <string> statement, RetryReason reason);
/// <summary> /// Is retryable failure due to a pre process execution failure or due to remoting (VM or AnyBuild) infrastructure error. /// </summary> public static bool IsPreProcessExecOrRemotingInfraFailure(this RetryReason retryReason) => retryReason.IsPreProcessExecRetryableFailure() || retryReason == RetryReason.VmExecutionError || retryReason == RetryReason.RemoteFallback;
public RetryAction RetryAfter(IRequest request, RetryReason reason) { return(RetryAction.Duration(null)); }
/// <summary> /// Constructor. /// </summary> private RetryInfo(RetryReason retryReason, RetryMode retryMode) { RetryReason = retryReason; RetryMode = retryMode; }
public RetryAction RetryAfter(IOperation ret, RetryReason reason) { return(RetryAction.WithDuration(null)); }
public static bool AlwaysRetry(this RetryReason reason) { return(reason == RetryReason.KvNotMyVBucket || reason == RetryReason.KvCollectionOutdated); }
private partial void LogRetryDueToAlwaysRetry(uint opaque, Redacted <string> key, RetryReason reason);
/// <nodoc/> private RetryInfo(RetryReason retryReason, RetryLocation retryLocation) { RetryReason = retryReason; RetryLocation = retryLocation; }
private partial void LogRetryDueToDuration(uint opaque, Redacted <string> key, RetryReason reason);
/// <summary> /// Returns a RetryInfo object to be retried on the Same Worker /// </summary> private static RetryInfo RetryOnSameWorker(RetryReason retryReason) { return(new RetryInfo(retryReason, RetryLocation.SameWorker)); }
public static void IncrementAttempts(this IRequest request, RetryReason reason) { request.Attempts++; request.RetryReasons.Add(reason); }
private static RetryInfo RetryInline(RetryReason retryReason) => new (retryReason, RetryMode.Inline);