Skip to content

feat(preprod): Add confluent producer handling behind flag#106624

Closed
NicoHinderling wants to merge 2 commits intomasterfrom
01-20-feat_preprod_add_confluent_producer_handling_behind_flag
Closed

feat(preprod): Add confluent producer handling behind flag#106624
NicoHinderling wants to merge 2 commits intomasterfrom
01-20-feat_preprod_add_confluent_producer_handling_behind_flag

Conversation

@NicoHinderling
Copy link
Contributor

@NicoHinderling NicoHinderling commented Jan 20, 2026

Roll out switching traffic for preprod from the regular Producer class to the ConfluentProducer class in order to get extra producer metrics

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 20, 2026
Copy link
Contributor Author

NicoHinderling commented Jan 20, 2026

@fpacifici
Copy link
Contributor

Roll out switching traffic for preprod from the regular Producer class to the ConfluentProducer class in order to get extra producer metrics

Which additional metrics do you need ?

@NicoHinderling
Copy link
Contributor Author

Roll out switching traffic for preprod from the regular Producer class to the ConfluentProducer class in order to get extra producer metrics

Which additional metrics do you need ?

launchpad.consumer.arroyo.producer.produce_status is the main one

Base automatically changed from add-preprod-flag-confluent-producer to master January 20, 2026 22:30
@NicoHinderling NicoHinderling force-pushed the 01-20-feat_preprod_add_confluent_producer_handling_behind_flag branch 2 times, most recently from 451360d to f9b5d03 Compare January 20, 2026 22:30
@NicoHinderling NicoHinderling marked this pull request as ready for review January 20, 2026 22:31
@NicoHinderling NicoHinderling requested a review from a team as a code owner January 20, 2026 22:31
@NicoHinderling NicoHinderling force-pushed the 01-20-feat_preprod_add_confluent_producer_handling_behind_flag branch from f9b5d03 to e5a3d33 Compare January 20, 2026 22:36
Copy link
Contributor

@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 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

_preprod_confluent_producer = get_confluent_producer(
build_kafka_producer_configuration(default_config=cluster_options)
)
return _preprod_confluent_producer
Copy link
Contributor

Choose a reason for hiding this comment

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

Confluent producer lacks shutdown flush, risking message loss

High Severity

The new _preprod_confluent_producer global variable lacks shutdown handling. Unlike SingletonProducer, which registers an atexit handler to flush pending messages and close the producer on process termination, the Confluent producer path only calls poll(0) (non-blocking) after each produce. Messages still in the producer's internal buffer when the process exits will be silently lost. This is especially concerning since the comment indicates this is for retryable tasks, but message loss would prevent retries.

Fix in Cursor Fix in Web

_preprod_confluent_producer = get_confluent_producer(
build_kafka_producer_configuration(default_config=cluster_options)
)
return _preprod_confluent_producer
Copy link
Contributor

Choose a reason for hiding this comment

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

Confluent producer missing excluded config keys

Medium Severity

The original _get_preprod_producer explicitly excludes compression.type and message.max.bytes from the Kafka configuration, but _get_or_create_confluent_producer does not. The default cluster config sets compression.type: lz4 and message.max.bytes: 50000000. This means the new Confluent producer path will use different Kafka settings than the original producer, which could cause compatibility issues or unexpected behavior. This exclusion pattern is used by multiple other producers in the codebase, suggesting these keys cause problems for certain topics.

Fix in Cursor Fix in Web

@getsantry
Copy link
Contributor

getsantry bot commented Feb 11, 2026

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry bot added the Stale label Feb 11, 2026
@getsantry getsantry bot closed this Feb 19, 2026
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 Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants