squah-confluent commented on PR #21279:
URL: https://github.com/apache/kafka/pull/21279#issuecomment-3836196135

   > > I also found a second race which can cause premature retries, where 
maybeRequestNextBlock reads a stale backoffDeadlineMs and then the in-flight 
request fails.
   > 
   > If you’re okay with it, I can file an issue and follow up with a separate 
PR for this. If you were already planning to address it yourself, please let me 
know and I’ll hold off!
   > 
   > Also, regarding the fix, I was thinking that reordering the operations as 
follows might address the issue, but we can discuss this further in the next PR.
   
   Thanks for the fix. Please go ahead and file the issue and PR!
   
   I can think of two ways to fix it:
   1. Pack `backoffDeadlineMs` and `requestInFlight` into the same atomic, by 
creating a record class to hold them.
   2. Set `requestInFlight` and then unset it if `backoffDeadlineMs` is not 
satisfied, which is your fix. I think this option could be nicer.


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

Reply via email to