Skip to content

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

Open
oneby-wang wants to merge 1 commit intomasterfrom
fix_testDoIndividualBatchAckNeverAffectIsDuplicate
Open

[fix][test] Use AtomicBoolean.compareAndSet() to guarantee atomicity in testDoIndividualBatchAckNeverAffectIsDuplicate() method#27
oneby-wang wants to merge 1 commit intomasterfrom
fix_testDoIndividualBatchAckNeverAffectIsDuplicate

Conversation

@oneby-wang
Copy link
Owner

@oneby-wang oneby-wang commented Feb 5, 2026

Motivation

See apache#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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant