Skip to content

Conversation

@erobot
Copy link
Contributor

@erobot erobot commented Dec 28, 2023

Fixes #319

Motivation

Already created producer should not fail after new partition producers creation failure.

Modifications

ProducerImpl: Add an option retryOnCreationError to control whether to retry on creation error
PartitionedProducerImpl: Use retryOnCreationError=true to create new partition producers

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added test for new partition producer creation failure

Documentation

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

  • doc-not-needed
    Bug fix only.

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@BewareMyPower BewareMyPower added this to the 3.5.0 milestone Dec 29, 2023
Comment on lines 666 to 667
waitUntil(std::chrono::seconds(1), [&producer]() -> bool { return producer.isConnected(); });
ASSERT_TRUE(producer.isConnected());
Copy link
Contributor

Choose a reason for hiding this comment

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

You can check the returned value of waitUntil.

ASSERT_TRUE(waitUntil(std::chrono::seconds(1), [&producer]() -> bool { return producer.isConnected(); }));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed.

@BewareMyPower BewareMyPower merged commit a4b7f12 into apache:main Jan 4, 2024
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] error handling for new partition producer creation failure

2 participants