Skip to content

Commit

Permalink
[FIX] Retry recreating ordered consumer on insufficient resources error
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio committed Feb 23, 2023
1 parent edb105c commit f086913
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js.go
Expand Up @@ -1989,6 +1989,11 @@ func (sub *Subscription) resetOrderedConsumer(sseq uint64) {
}

if cinfo.Error != nil {
if cinfo.Error.ErrorCode == JSErrCodeInsufficientResourcesErr {
// retry for insufficient resources, as it may mean that client is connected to a running
// server in cluster while the server hosting R1 JetStream resources is restarting
return
}
pushErr(cinfo.Error)
return
}
Expand Down
1 change: 1 addition & 0 deletions jserrors.go
Expand Up @@ -115,6 +115,7 @@ type ErrorCode uint16
const (
JSErrCodeJetStreamNotEnabledForAccount ErrorCode = 10039
JSErrCodeJetStreamNotEnabled ErrorCode = 10076
JSErrCodeInsufficientResourcesErr ErrorCode = 10023

JSErrCodeStreamNotFound ErrorCode = 10059
JSErrCodeStreamNameInUse ErrorCode = 10058
Expand Down

0 comments on commit f086913

Please sign in to comment.