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

[fix][broker] AbstractBatchedMetadataStore - use AlreadyClosedException instead of IllegalStateException #19284

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

eolivelli
Copy link
Contributor

Motivation

When the broker is shutting down AbstractBatchedMetadataStore completes exceptionally the pending operations with a generic IllegalStateException. All the code that is depending on the MetadataStore usually expects instances of MetadataStoreException and they may not properly react to this error.

This is generally not a big deal because the broker is shutting down, but we should improve it

Modifications

Complete the pending operations with AlreadyClosedException instead of IllegalStateException

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@eolivelli eolivelli self-assigned this Jan 19, 2023
@eolivelli eolivelli added this to the 2.12.0 milestone Jan 19, 2023
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 19, 2023
Copy link
Contributor

@HQebupt HQebupt left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@codelipenghui codelipenghui left a comment

Choose a reason for hiding this comment

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

Do we have a test to cover this case?

@eolivelli
Copy link
Contributor Author

@codelipenghui I am not sure that it is worth to cover this change with a test case.
This fact happens when the broker is shutting down.

@eolivelli eolivelli changed the title [bugfix] AbstractBatchedMetadataStore - use AlreadyClosedException instead of IllegalStateException [fix][broker] AbstractBatchedMetadataStore - use AlreadyClosedException instead of IllegalStateException Jan 19, 2023
@eolivelli eolivelli merged commit d3e112e into apache:master Jan 19, 2023
eolivelli added a commit that referenced this pull request Jan 19, 2023
…on instead of IllegalStateException (#19284)

(cherry picked from commit d3e112e)
eolivelli added a commit that referenced this pull request Jan 19, 2023
…on instead of IllegalStateException (#19284)

(cherry picked from commit d3e112e)
eolivelli added a commit to datastax/pulsar that referenced this pull request Jan 19, 2023
…on instead of IllegalStateException (apache#19284)

(cherry picked from commit d3e112e)
@eolivelli eolivelli deleted the fix/metastore-close-illegalstate branch January 19, 2023 13:36
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.

6 participants