Skip to content

[fix][client-cpp] Fail producers immediately when topic is terminated#567

Open
dwang-qm wants to merge 2 commits intoapache:mainfrom
dwang-qm:fix/topic-terminated-producer
Open

[fix][client-cpp] Fail producers immediately when topic is terminated#567
dwang-qm wants to merge 2 commits intoapache:mainfrom
dwang-qm:fix/topic-terminated-producer

Conversation

@dwang-qm
Copy link
Copy Markdown

Fixes #566

Motivation

When a topic is terminated, producer operations should fail immediately with ResultTopicTerminated. Before this change, the C++ client could treat ResultTopicTerminated as retryable during producer creation and reconnection flows, which caused retries until the operation timed out instead of surfacing the terminal condition immediately.

Modifications

  • Treat ResultTopicTerminated as a non-retryable producer error.
  • Return the terminal result during producer creation and disconnection/reconnection handling.
  • Reject later sends from a terminated producer with ResultTopicTerminated.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added ProducerTest.testCreateProducerAfterTopicTermination
  • Added ProducerTest.testSendAfterTopicTerminationReconnect
  • These tests are included in the standard CI unit-tests job.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    This change only adjusts producer error handling for terminated topics and does not require user-facing documentation changes.

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

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.

[Bug] Producer retries until timeout after topic termination

2 participants