I think the determination of the droppedEntriesCount for a given observer can be inconsistent with the data reported to the observer. This is because we flush the entries in the buffers when using the buffered option and start listening to entries when calling observe, but the determination of droppedEntriesCount happens when the callback is invoked.
Let's take the following example:
We create an observer and call observe for resource type, with the buffered option set to true.
At that moment, the observer buffer is filled with all the existing entries in the buffer.
Multiple entries of type resource are added to the buffer. The buffer becomes full and drops N entries, but the previous observer didn't miss any entries as they were added to its buffer.
The observer callback is invoked with the entries in its buffer. The observer didn't miss any entries and droppedEntriesCount is N (inconsistent with the data reported to the observer).
I think the determination of droppedEntriesCount should be made in observe, not in the execution of its callback.
I think the determination of the
droppedEntriesCount
for a given observer can be inconsistent with the data reported to the observer. This is because we flush the entries in the buffers when using thebuffered
option and start listening to entries when callingobserve
, but the determination ofdroppedEntriesCount
happens when the callback is invoked.Let's take the following example:
observe
forresource
type, with the buffered option set totrue
.resource
are added to the buffer. The buffer becomes full and drops N entries, but the previous observer didn't miss any entries as they were added to its buffer.droppedEntriesCount
is N (inconsistent with the data reported to the observer).I think the determination of
droppedEntriesCount
should be made inobserve
, not in the execution of its callback.