Closed piotr-karas closed 2 weeks ago
Hey!
Thanks for the detailed report. We're looking into it.
I was able to replicate this in server test thanks for details reproduction example. Thanks for that! We're working on a fix.
@piotr-karas fix is already in main. It will be part of next patch release.
Thanks!
Observed behavior
Summary and example of the problem:
I have
test
stream which contains exactly three messages in following subjects:events.subjectOne
events.subjectTwo
events.subjectThree
I have two consumers created on this stream:
filter_subjects: ["events.*"]
pattern,filter_subjects: ["events.subjectOne","events.subjectTwo","events.subjectThree",]
After creating consumers first of them has
num_pending
messages set to 3, which is correct value, but second one receivesnum_pending
as 2, even though it should also receive all messages. This only happens when consumers have setdeliver_policy
toby_start_time
.Similar behavior could be observed using different subject combinations, but probably at least 2 different subjects are required with multiple messages. When only two messages exists both consumers have
num_pending
set to 2, which is correct.Detailed messages received using
nats sub ">"
Expected behavior
In example above second consumer should have
num_pending
set to 3, as its filter covers all existing messages. Due to wrongnum_pending
number second consumer is not receiving all messages.Server and client version
nats-server in Docker: nats:2.10.18-alpine3.20 nats-cli: 0.0.35 nats client Deno: nats@v1.28.2
Host environment
Windows 10 Pro 22H2
Steps to reproduce
See simple script written in Deno which is reproducing this behavior: nats-server-bug.zip