adixitconfluent commented on code in PR #20124: URL: https://github.com/apache/kafka/pull/20124#discussion_r2200500905
########## core/src/main/java/kafka/server/share/SharePartition.java: ########## @@ -2834,26 +2850,35 @@ final class AcquisitionLockTimerTask extends TimerTask { private final String memberId; private final long firstOffset; private final long lastOffset; + private boolean hasExpired; AcquisitionLockTimerTask(long delayMs, String memberId, long firstOffset, long lastOffset) { super(delayMs); this.expirationMs = time.hiResClockMs() + delayMs; this.memberId = memberId; this.firstOffset = firstOffset; this.lastOffset = lastOffset; + this.hasExpired = false; } long expirationMs() { return expirationMs; } + boolean hasExpired() { + return hasExpired; Review Comment: Agreed, I think it makes sense to make this function thread safe. I have added synchronized around `hasExpired()` and `run()` functions. -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org