Skip to content

Commit

Permalink
[FIXED] Return msg to pool if 429 Too Many Requests (#6443)
Browse files Browse the repository at this point in the history
Message was not returned to the pool if there was an error.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
  • Loading branch information
derekcollison authored Feb 3, 2025
2 parents 9f96387 + c06a88b commit 3f9e342
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -4338,6 +4338,7 @@ func (mset *stream) queueInbound(ib *ipQueue[*inMsg], subj, rply string, hdr, ms
im := inMsgPool.Get().(*inMsg)
im.subj, im.rply, im.hdr, im.msg, im.si, im.mt = subj, rply, hdr, msg, si, mt
if _, err := ib.push(im); err != nil {
im.returnToPool()
mset.srv.RateLimitWarnf("Dropping messages due to excessive stream ingest rate on '%s' > '%s': %s", mset.acc.Name, mset.name(), err)
if rply != _EMPTY_ {
hdr := []byte("NATS/1.0 429 Too Many Requests\r\n\r\n")
Expand Down

0 comments on commit 3f9e342

Please sign in to comment.