Skip to content

feat(uptime): roll out TaskProducer to EAP producer#118584

Open
bmckerry wants to merge 4 commits into
masterfrom
ben/uptime-eap-taskproducer
Open

feat(uptime): roll out TaskProducer to EAP producer#118584
bmckerry wants to merge 4 commits into
masterfrom
ben/uptime-eap-taskproducer

Conversation

@bmckerry

Copy link
Copy Markdown
Member

Followup to #118583

This PR updates the uptime eap_producer to use TaskProducer in tasks.

The reason for this change is that SingletonProducer doesn't guarantee at-least-once delivery when used inside a task. TaskProducer keeps track of any producer futures generated as a part of task execution, and only marks a task as successful if all producer futures succeed.

To ensure a safe rollout, workers will instantiate an instance of the old and new producers, and cut over to the new producers based on a rollout option. This means that task futures won't be properly tracked while the rollout option is <1.0, but since our base state is to just ignore producer futures that's acceptable.

@bmckerry bmckerry requested review from a team as code owners June 26, 2026 19:12
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 26, 2026

@cursor cursor Bot left a comment

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.

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

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 145685c. Configure here.

):
_eap_items_taskproducer.produce(ArroyoTopic(topic), payload)
else:
_eap_items_producer.produce(ArroyoTopic(topic), payload)

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.

Rollout evaluated per message

Medium Severity

in_random_rollout is invoked inside the loop over trace_items, so each EAP message gets an independent rollout draw. For checks with multiple redirect trace items, one call to produce_eap_uptime_result can mix TaskProducer and SingletonProducer paths, so a task may finish before untracked singleton produces complete.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 145685c. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It might be better if only one rollout check was done for all of the items. It will be fewer options checks and you will avoid spreading messages across the two producer instances.

Comment thread src/sentry/uptime/consumers/eap_producer.py
Base automatically changed from ben/preprod-taskproducer to master June 26, 2026 19:59
@bmckerry bmckerry requested a review from a team as a code owner June 26, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants