You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "squah-confluent (via GitHub)" <gi...@apache.org> on 2026/02/01 19:05:28 UTC

Re: [PR] KAFKA-20058: Fix race condition on backoffDeadlineMs on RPCProducerIdManager causing premature retries [kafka]

squah-confluent commented on code in PR #21279:
URL: https://github.com/apache/kafka/pull/21279#discussion_r2751814180


##########
transaction-coordinator/src/main/java/org/apache/kafka/coordinator/transaction/RPCProducerIdManager.java:
##########
@@ -115,7 +115,7 @@ private void maybeRequestNextBlock() {
                     requestInFlight.compareAndSet(false, true)) {
                 sendRequest();
                 // Reset backoff after a successful send.
-                backoffDeadlineMs.set(NO_RETRY);
+                backoffDeadlineMs.compareAndSet(retryTimestamp, NO_RETRY);

Review Comment:
   Thank you for fixing the bug!
   
   Could we consider only updating `backoffDeadlineMs` together with the clearing of `requestInFlight`? That way we don't have to think about the race when setting `backoffDeadlineMs` at all, since it would be only set at the end of the in-flight request.



-- 
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