Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 1259][producer] Prevent panic when calling Flush on closed producer #1260

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

Gilthoniel
Copy link
Contributor

Fixes #1259

Motivation

When calling Flush or FlushWithCtx after closing the producer, it will panic.

Modifications

Check the state of the producer before proceeding with a flush and return an error if it is closed already.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • Added integration test to call FlushWithCtx after Close and see that it returns an error

Does this pull request potentially affect one of the following parts:

None

Documentation

  • Does this pull request introduce a new feature? no

Copy link
Member

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

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

LGTM.

@crossoverJie crossoverJie merged commit fb805c0 into apache:master Jul 29, 2024
7 checks passed
@crossoverJie crossoverJie added this to the v0.14.0 milestone Jul 29, 2024
RobertIndie pushed a commit that referenced this pull request Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when calling Flush after Close
4 participants