Skip to content

chore: finish up the move to atomic types#3399

Merged
dnwe merged 2 commits intoIBM:mainfrom
puellanivis:chore-finish-up-atomic-usage
Dec 17, 2025
Merged

chore: finish up the move to atomic types#3399
dnwe merged 2 commits intoIBM:mainfrom
puellanivis:chore-finish-up-atomic-usage

Conversation

@puellanivis
Copy link
Copy Markdown
Collaborator

This completes the change in #3277 and rolls out all atomics usage to using the types, rather than the bare functions.

This already found a few usages that had inconsistently used atomic functions on some values.

Comment on lines +401 to +402
msg.Offset = pc.suppressedHighWaterMarkOffset
pc.suppressedHighWaterMarkOffset++
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Rechecked this, and yes, the usage is indeed always made under lock.

Comment on lines +381 to +384
t *testing.T
clientID string
isCapped bool
sink *testFuncConsumerGroupSink
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These are set at initialisation and never changed after, and thus can be accessed freely without mutex.

Comment on lines +392 to +393
claims map[string]int
errs []error
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These are the two fields that can update after initialization, and are already correctly protected by mutexes. Their movement to here is just to match convention of putting mutex protected values below the mutex that protects them.

@puellanivis puellanivis force-pushed the chore-finish-up-atomic-usage branch from 1269371 to 0c3df26 Compare December 2, 2025 14:36
@dnwe dnwe added the chore label Dec 17, 2025
Copy link
Copy Markdown
Collaborator

@dnwe dnwe left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM

@dnwe dnwe merged commit 9253162 into IBM:main Dec 17, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants