From 4b69c16f1ac3e8124d1f9ad20331ae8b55c765e3 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 30 Jun 2022 14:52:28 +0300 Subject: [PATCH] Allow retries on message taking too long errors --- messagetracking.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/messagetracking.go b/messagetracking.go index b74f09e..fbb0ab3 100644 --- a/messagetracking.go +++ b/messagetracking.go @@ -71,12 +71,8 @@ func errorToStatusReason(err error) (reason event.MessageStatusReason, isCertain return event.MessageStatusUnsupported, true, false, true case errors.Is(err, errTimeoutBeforeHandling): return event.MessageStatusTooOld, true, true, true - case errors.Is(err, context.DeadlineExceeded): + case errors.Is(err, context.DeadlineExceeded), errors.Is(err, errMessageTakingLong): return event.MessageStatusTooOld, false, true, true - case errors.Is(err, errMessageTakingLong): - // Set can_retry=false here since we'll send another status event allowing the retry later - // Technically retrying when this happens is fine, but we'd just ignore it anyway. - return event.MessageStatusTooOld, false, false, true case errors.Is(err, errTargetNotFound), errors.Is(err, errTargetIsFake), errors.Is(err, errReactionDatabaseNotFound),