Skip to content

[fix][test] Use AtomicBoolean.compareAndSet() to guarantee atomicity in testDoIndividualBatchAckNeverAffectIsDuplicate() method#25217

Merged
nodece merged 1 commit intoapache:masterfrom
oneby-wang:fix_testDoIndividualBatchAckNeverAffectIsDuplicate
Feb 6, 2026
Merged

[fix][test] Use AtomicBoolean.compareAndSet() to guarantee atomicity in testDoIndividualBatchAckNeverAffectIsDuplicate() method#25217
nodece merged 1 commit intoapache:masterfrom
oneby-wang:fix_testDoIndividualBatchAckNeverAffectIsDuplicate

Conversation

@oneby-wang
Copy link
Copy Markdown
Contributor

Motivation

See #25208 (comment)

The assertResult.set(assertResult.get() || duplicate) operation can't guarantee atomicity. After being set to true, the value of assertResult may be overwritten to false again.

Modifications

Use assertResult.compareAndSet(false, duplicate) to guarantee atomicity.

Verifying this change

  • Make sure that the change passes the CI checks.

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

Matching PR in forked repository

PR in forked repository: oneby-wang#27

@oneby-wang
Copy link
Copy Markdown
Contributor Author

cc @Denovo1998

@lhotari
Copy link
Copy Markdown
Member

lhotari commented Feb 5, 2026

/pulsarbot rerun-failure-checks

@nodece nodece merged commit 6d95764 into apache:master Feb 6, 2026
99 of 105 checks passed
@lhotari lhotari added this to the 4.2.0 milestone Mar 24, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants