-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Ws client can't receive any more messages when number of timed-out messages reaches receiverQueueSize #2731
Description
Ws proxy controls message-delivery to ws client by using pendingMessages.
pendingMessages increases when ws proxy sends a message to ws client and It decreases when ws client acks to ws proxy.
If pendingMessages reaches receiverQueueSize, ws proxy stops to send a message until ws client acks.
Even if a message times out(cause by ws client unack), pendingMessages doesn't decrease and ws proxy keeps waiting for ack.
Expected behavior
When a message times out, pendingMessages decreases.
Actual behavior
pendingMessages doesn't decrease.
So ws client can't receive any more messages when timed-out messages reaches receiverQueueSize.
Steps to reproduce
- ws client connects to ws proxy url(
ws:<hostname>/ws/consumer/persistent/...?ackTimeoutMillis=1000&receiverQueueSize=2&subscriptionType=Shared) - producer sends 2 messages.
- ws client recieves 2 messages and not ack them.
- ws client doesn't receive any more messages until ws client reconnects even if
ackTimeoutMillis(1000ms) passes.
System configuration
Pulsar version: 1.22.1 and 2.2.1
pendingMessages
https://github.com/apache/pulsar/blob/branch-2.2/pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ConsumerHandler.java#L75