Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event backpressure #251

Merged

Conversation

matejpavlovic
Copy link
Contributor

@matejpavlovic matejpavlovic commented Sep 30, 2022

This PR implements backpressure for event processing within a node.

Active modules now cannot make the node's event buffers explode in size, as the node stops reading input from active modules when its internal event buffer grows above a configurable limit.

The limit on the internal event buffer is a "soft limit" in the sense that as long as there are fewer events than the limit in the buffer, an arbitrary event list can be added, which might result in the buffer's actual size "overshooting" the limit, if the event list being added is long. This should not be a big problem in practice though, as the list already occupies space in memory and the events are simply "moved" to the buffer, without creating another copy.

Resolves #100 .
Resolves #238 .

Copy link
Contributor

@sergefdrv sergefdrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nicely structured PR! Looks good, modulo a small comment 👍

eventbuffer.go Outdated Show resolved Hide resolved
This is necessary for the event processing backpressure to be effective.
Otherwise, even though the event buffers would be limited,
the batches of events passed to the modules for processing
would continue exploding in size
(up to, potentially, the size of the whole buffer).

Signed-off-by: Matej Pavlovic <[email protected]>
Signed-off-by: Matej Pavlovic <[email protected]>
Signed-off-by: Matej Pavlovic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finite buffers for incoming events from ActiveModules Event loop flow control
2 participants