-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Version: 3.3.0
In the case where a handler is removed after a message is sent, but before it is received then the pending count can be incremented, but not decremented. Consider the following sequence:
A message is delivered locally and a handler is found at line 366 in EventBusImpl.java. This increments the pending count metric and calls deliverToHandler. When the runOnContext block is scheduled it is determined that the handler has been removed at line 498 and so the message is never actually processed. As a result the pending count is never decremented making is seem like there are pending messages when in fact there aren't.
This happens most often with the "credit" handler which is installed to receive the credit based flow control messages. It is often the case that the hander gets removed because the producer has been closed, but the consumer on the other side doesn't know this and sends the credit update.