You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Phixsura (via GitHub)" <gi...@apache.org> on 2026/05/20 08:26:30 UTC
[PR] KAFKA-20404: Replace bulk DefaultStateUpdater atomicity excludes with field-level suppressions [kafka]
Phixsura opened a new pull request, #22333:
URL: https://github.com/apache/kafka/pull/22333
## Background
[KAFKA-20404](https://issues.apache.org/jira/browse/KAFKA-20404) tracks replacing the bulk SpotBugs atomicity excludes (introduced when SpotBugs was upgraded from 4.8.6 to 4.9.4) with per-field investigations. This PR handles `DefaultStateUpdater$StateUpdaterThread`, the second class in the series after `StreamThread` (#22320).
## Investigation
After removing `DefaultStateUpdater$StateUpdaterThread` from the two bulk excludes it appeared in (`AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE` at line 505 and `AT_NONATOMIC_64BIT_PRIMITIVE` at line 544 on trunk), SpotBugs reports exactly one field with warnings:
- `totalCheckpointLatency` at `DefaultStateUpdater.java:100`, flagged at line 732 (`measureCheckpointLatency`) and line 750 (`recordMetrics`).
Walking the call sites:
- `measureCheckpointLatency` is `private` and only called from within `StateUpdaterThread`: `restoreTasks`, `pauseTasks`, `resumeTasks`, `removeUpdatingTask`, `maybeCheckpointTasks`.
- `recordMetrics` is `private` and only called from `StateUpdaterThread.runOnce` (line 213).
- All callers run on the `StateUpdaterThread` itself (the inner class extends `Thread`).
So `totalCheckpointLatency` is thread-confined and the SpotBugs warnings are false positives.
## Changes
- Remove `DefaultStateUpdater$StateUpdaterThread` from the two bulk `<Or>` blocks.
- Add two targeted `<Match>` blocks scoped to the class plus the `totalCheckpointLatency` field, each with a rationale comment explaining the thread-confinement, one per bug pattern.
## Verification
- `:streams:spotbugsMain --rerun-tasks` clean.
- `:streams:checkstyleMain` / `:streams:checkstyleTest` / `:streams:spotbugsTest` clean.
- `:streams:test --tests "*DefaultStateUpdater*"` all green.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20404: Replace bulk DefaultStateUpdater atomicity excludes with field-level suppressions [kafka]
Posted by "Phixsura (via GitHub)" <gi...@apache.org>.
Phixsura commented on PR #22333:
URL: https://github.com/apache/kafka/pull/22333#issuecomment-4505725903
> Thanks for the PR, LGTM
Thanks! Waiting for one more approval before merging.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20404: Replace bulk DefaultStateUpdater atomicity excludes with field-level suppressions [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22333:
URL: https://github.com/apache/kafka/pull/22333#issuecomment-6307506494
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20404: Replace bulk DefaultStateUpdater atomicity excludes with field-level suppressions [kafka]
Posted by "Phixsura (via GitHub)" <gi...@apache.org>.
Phixsura commented on PR #22333:
URL: https://github.com/apache/kafka/pull/22333#issuecomment-4552788946
@lucasbru @mjsax friendly ping — smjn approved a few days ago, would either of you have a moment to commit?
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-20404: Replace bulk DefaultStateUpdater atomicity excludes with field-level suppressions [kafka]
Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru merged PR #22333:
URL: https://github.com/apache/kafka/pull/22333
--
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org