feat(streams): Add a fake Kafka-less source for profiling pipelines - #360
feat(streams): Add a fake Kafka-less source for profiling pipelines#360fpacifici wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 302a613. Configure here.
|
|
||
| fn paused(&self) -> Result<HashSet<Partition>, ConsumerError> { | ||
| Ok(HashSet::new()) | ||
| } |
There was a problem hiding this comment.
Fake consumer ignores pause
Medium Severity
FakeConsumer treats pause, resume, and paused as no-ops, so it can still return new messages after Arroyo applies backpressure via MessageRejected. Arroyo expects a paused consumer’s poll to return None; violating that can break or crash the processor under load, which is exactly when profiling pipelines tend to hit backpressure.
Reviewed by Cursor Bugbot for commit 302a613. Configure here.


Adds a profiling mode that runs a pipeline end to end without a Kafka broker. A new
FakeSourceprimitive synthesises messages of random bytes at a configurable rate and terminates after a fixed count, so the cost of the pipeline machinery itself (Python/Rust step execution) can be measured in isolation.The idea is to instantiate the Arroyo processor with a fake consumer class instead of making the processor create its own consumer.
This can be extended into other types of sources including mock consumers for unit tests without kafka.
The fake source, right now, is pretty bare bone, it does not do anything regarding assignment, partitioning and rebalancing. This is ok as this is meant to profile the pipelines under steady load.
Dependency note for review
We were picking up the latest version of arroyo, though a breaking change was introduced in getsentry/arroyo#540, so we need to limit the version and adapt to the change in another PR.