Skip to content

droppedEntriesCount can be inconsistent with reported entries #214

@rubennorte

Description

@rubennorte

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions