Phixsura opened a new pull request, #22320: URL: https://github.com/apache/kafka/pull/22320
Removes `StreamThread` from the three class-level bulk Spotbugs exclusions for atomicity warnings (`AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE`, `AT_NONATOMIC_64BIT_PRIMITIVE`, `AT_STALE_THREAD_WRITE_OF_PRIMITIVE`) and replaces them with field level suppressions that name each affected field and carry a one line rationale. Spotbugs reports 13 warnings against `StreamThread` once the bulk excludes are lifted, all on a small set of bookkeeping fields: * `now`, `lastPollMs`, `lastLogSummaryMs`, `totalCommittedSinceLastSummary` (64 bit primitive) * `numIterations` (non atomic RMW + stale write) * `streamsGroupReady` (stale write) All accesses to these fields are inside methods that run on the StreamThread itself (the run loop and helpers it calls). The only cross thread reader I could find is `currentNumIterations()`, which is `// visible for testing` and is invoked from `StreamThreadTest` after a synchronous `runOnce(...)` on the same test thread, so it does not introduce a real cross thread access. Each suppression names the specific fields so any future field added to `StreamThread` is not silently swept under the same exclusion. Verified with `./gradlew streams:spotbugsMain` (clean) and `./gradlew streams:test --tests StreamThreadTest`. This is the first of a series of PRs for [KAFKA-20404](https://issues.apache.org/jira/browse/KAFKA-20404). Follow up PRs will tackle the remaining classes one at a time. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
