Skip to content

feat(dlq): add dlq support rust side#277

Open
victoria-yining-huang wants to merge 2 commits intomainfrom
vic/add_dlq
Open

feat(dlq): add dlq support rust side#277
victoria-yining-huang wants to merge 2 commits intomainfrom
vic/add_dlq

Conversation

@victoria-yining-huang
Copy link
Contributor

@victoria-yining-huang victoria-yining-huang commented Mar 20, 2026

ticket

PR1 (this): add arroyo dlq support rust side - noop
PR2: add dlq config in deployment config yaml - noop
PR3: wire everything together, integration tests
PR4: enable by default, add default topics

@victoria-yining-huang victoria-yining-huang requested a review from a team as a code owner March 20, 2026 19:50
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Streams

  • Add consumer group override for StreamSource by fpacifici in #273
  • Add topic name override for StreamSource and StreamSink by fpacifici in #257

Other

  • (dlq) Add dlq support rust side by victoria-yining-huang in #277

Internal Changes 🔧

Deps

  • Bump slab from 0.4.10 to 0.4.12 in /sentry_streams/tests/rust_test_functions by dependabot in #275
  • Bump tracing-subscriber from 0.3.19 to 0.3.20 in /sentry_streams/tests/rust_test_functions by dependabot in #261
  • Bump bytes from 1.10.1 to 1.11.1 in /sentry_streams/sentry_streams/examples/rust_simple_map_filter/rust_transforms by dependabot in #259
  • Bump tracing-subscriber from 0.3.19 to 0.3.20 in /sentry_streams/sentry_streams/examples/rust_simple_map_filter/rust_transforms by dependabot in #274
  • Bump time from 0.3.41 to 0.3.47 in /sentry_streams by dependabot in #267
  • Bump bytes from 1.10.1 to 1.11.1 in /sentry_streams/tests/rust_test_functions by dependabot in #268

🤖 This preview updates automatically when you update the PR.

Comment on lines +17 to +21

enabled: bool
topic: str
producer_config: "KafkaProducerConfig"

Copy link

Choose a reason for hiding this comment

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

Bug: The Python adapter in rust_arroyo.py doesn't read the dlq configuration or pass it to the Rust ArroyoConsumer, rendering the DLQ feature non-functional.
Severity: CRITICAL

Suggested Fix

Update rust_arroyo.py to read the dlq configuration from the source config. If present, construct the corresponding Rust DlqConfig object and pass it as the dlq_config argument when initializing the ArroyoConsumer. Add integration tests to verify the DLQ functionality.

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: sentry_streams/sentry_streams/config_types.py#L17-L21

Potential issue: The pull request adds Dead Letter Queue (DLQ) support, with a
`DlqConfig` defined in Python and the Rust consumer expecting a `dlq_config` parameter.
However, the Python adapter in `rust_arroyo.py` that instantiates the `ArroyoConsumer`
never reads the `dlq` key from the configuration dictionary and does not pass it during
initialization. As a result, any user-provided DLQ configuration will be silently
ignored, and the DLQ functionality will not work. Invalid messages will be dropped
instead of being routed to the configured dead-letter topic.

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

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Python type stub missing new DLQ class and parameter
    • Updated rust_streams.pyi to add PyDlqConfig and the optional dlq_config argument on ArroyoConsumer.__init__ to match the Rust-exposed interface.

Create PR

Or push these changes by commenting:

@cursor push cb8d770063
Preview (cb8d770063)
diff --git a/sentry_streams/sentry_streams/rust_streams.pyi b/sentry_streams/sentry_streams/rust_streams.pyi
--- a/sentry_streams/sentry_streams/rust_streams.pyi
+++ b/sentry_streams/sentry_streams/rust_streams.pyi
@@ -41,6 +41,12 @@
         override_params: Mapping[str, str],
     ) -> None: ...
 
+class PyDlqConfig:
+    topic: str
+    producer_config: PyKafkaProducerConfig
+
+    def __init__(self, topic: str, producer_config: PyKafkaProducerConfig) -> None: ...
+
 class PyMetricConfig:
     def __init__(
         self,
@@ -105,6 +111,7 @@
         schema: str | None,
         metric_config: PyMetricConfig | None = None,
         write_healthcheck: bool = False,
+        dlq_config: PyDlqConfig | None = None,
     ) -> None: ...
     def add_step(self, step: RuntimeOperator) -> None: ...
     def run(self) -> None: ...

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

producer_config,
}
}
}
Copy link

Choose a reason for hiding this comment

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

Python type stub missing new DLQ class and parameter

Medium Severity

The rust_streams.pyi type stub is not updated to reflect the new Rust-side changes. The PyDlqConfig class exposed via m.add_class and the new dlq_config parameter on ArroyoConsumer.__init__ are missing from the stub. This file is the typed interface used by mypy and IDEs for the Rust extension module, and the project has mypy integration tests that rely on it. When PR3 wires the DLQ feature through Python, the missing stub definitions will cause type-checking failures.

Fix in Cursor Fix in Web

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.

1 participant