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 race condition in FaultInjectionMetadataStore#programmedFailure #13007

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

Jason918
Copy link
Contributor

@Jason918 Jason918 commented Nov 29, 2021

Motivation

org.apache.pulsar.metadata.impl.FaultInjectionMetadataStore#programmedFailure is not thread safe.
Multi threads can get the same failure at the same time (At Line 195), resulting one failure returned multiply times, which I believe is not the design purpose.

Modifications

Only return failure when remove is success. (failures is a thread safe list.)

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as ManagedLedgerErrorsTest

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

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • no-need-doc
    Bug fix

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Nov 29, 2021
@Jason918
Copy link
Contributor Author

@eolivelli PTAL. It's the same issue you mentioned in #13005

@merlimat merlimat added the type/bug The PR fixed a bug or issue reported a bug label Nov 29, 2021
@merlimat merlimat added this to the 2.10.0 milestone Nov 29, 2021
@merlimat merlimat merged commit 9add033 into apache:master Nov 29, 2021
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants