Skip to content

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

Merged
crossoverJie merged 1 commit into
apache:masterfrom
Gilthoniel:bugfix/panic-on-flush
Jul 29, 2024
Merged

crossoverJie merged 1 commit into
apache:masterfrom
Gilthoniel:bugfix/panic-on-flush

Conversation

@Gilthoniel

Copy link
Copy Markdown
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

@crossoverJie crossoverJie left a comment

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.

LGTM.

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