Closed ideahitme-github closed 5 months ago
Maybe something like this would be a good fix:
https://github.com/nats-io/nats.net/compare/main...ideahitme-github:nats.net:patch-1
@ideahitme-github I think I should not count heartbeats at all. Take a look at this. https://github.com/nats-io/nats.net/pull/881/files Heartbeat messages get a false from this
BeforeChannelAddCheck.Invoke(msg)
so I'm not going to even count them.
that works too. Thanks @scottf
Observed behavior
When a subscription with heartbeat enabled has been running for a while ( few days) it is eventually guaranteed to lead to a slow consumer exception. I believe the reason for this is that every heartbeat received increases the pending message count and that never gets decremented. Eventually it will exceed the pending message limit and when a new (non heartbeat) message is received it will throw slow consumer exception
Expected behavior
Subscription can stay alive as long as it wants without leading to a slow consumer exception
Server and client version
Client v.1.0.4 (but I believe the problem exists in current version as well) Server v.2.9.16
Host environment
No response
Steps to reproduce
Create a subscription e.g.
Wait couple of minutes and then push a message into the jetstream and see
AsyncErrorEventHandler
being triggered withSlow Consumer
exception