Add a few metrics on main thread contention points#328
Merged
Conversation
Expose gauge metrics and debug logs to diagnose backpressure and slow downstream submits during batch drain and Python delegate poll/submit. Co-authored-by: Cursor <cursoragent@cursor.com>
evanh
approved these changes
Jun 4, 2026
bmckerry
approved these changes
Jun 4, 2026
This was referenced Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After shipping the errors pipeline I saw a huge throughput problem on semantically partitioned topics with large messages. Basically this cannot keep up even with 64 replicas.
The batch time seems to fill in batches with 3k messages every second, which should be more than enough.
The parallel step is not saturated.
So the likely option is that something is really slow in the code between steps in arroyo which run on the main thread.
The sensitive areas are constituted by the calls to submit and poll.
Changes:
BatchStepoutbound drain (next_step.submit), including duration, outbound queue depth, and submit outcome.PythonAdapterPython delegate submit, poll/handle paths, and downstreamnext_strategy.submit.Made with Cursor