From b3f214900fee3fa0ab70930e420c58d7f69d9bd3 Mon Sep 17 00:00:00 2001 From: Piotr Piotrowski Date: Fri, 4 Aug 2023 14:39:59 +0200 Subject: [PATCH] [FIXED] Resetting ordered consumer after context timeout (#1360) Signed-off-by: Piotr Piotrowski --- js.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js.go b/js.go index b83cedb4f..bd8cb8bcc 100644 --- a/js.go +++ b/js.go @@ -2029,7 +2029,7 @@ func (sub *Subscription) resetOrderedConsumer(sseq uint64) { cinfo, err := js.upsertConsumer(jsi.stream, consName, cfg) if err != nil { var apiErr *APIError - if errors.Is(err, ErrJetStreamNotEnabled) || errors.Is(err, ErrTimeout) { + if errors.Is(err, ErrJetStreamNotEnabled) || errors.Is(err, ErrTimeout) || errors.Is(err, context.DeadlineExceeded) { // if creating consumer failed, retry return } else if errors.As(err, &apiErr) && apiErr.ErrorCode == JSErrCodeInsufficientResourcesErr {