Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ dependencies = [
"rfc3339-validator>=0.1.2",
"rfc3986-validator>=0.1.1",
# [end] jsonschema format validators
"sentry-arroyo>=2.38.7",
"sentry-arroyo>=2.39.0",
"sentry-conventions>=0.3.0",
"sentry-forked-email-reply-parser>=0.5.12.post1",
"sentry-kafka-schemas>=2.1.27",
Expand Down
1 change: 1 addition & 0 deletions src/sentry/spans/consumers/process/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def create_with_partitions(
buffer,
),
next_step=flusher,
better_backpressure=True,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The better_backpressure=True parameter is missing in a fallback path used only in contrived test scenarios where multiprocessing is disabled but multiple processes are requested.
Severity: LOW

Suggested Fix

In src/sentry/utils/arroyo.py, update the run_task_with_multiprocessing function to pass better_backpressure=True to the RunTask constructor within the fallback logic. This will ensure consistent behavior across all code paths, even those not used in production.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/spans/consumers/process/factory.py#L125

Potential issue: In a specific, non-production scenario, the `better_backpressure=True`
parameter is not applied to the stream processor. This occurs when the
`KAFKA_CONSUMER_FORCE_DISABLE_MULTIPROCESSING` setting is enabled (typically only for
tests) while simultaneously requesting more than one process (`num_processes > 1`). The
primary production path, which uses a single process, correctly receives the
`better_backpressure=True` parameter. The fallback path, handled by
`run_task_with_multiprocessing()` in `src/sentry/utils/arroyo.py`, was not updated to
include this parameter, leading to the inconsistency. However, this combination of
settings is not used in production or existing tests.

Also affects:

  • src/sentry/utils/arroyo.py

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's legitimate but not worth fixing. i just want to see this rolled out in prod


batch = BatchStep(
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading