Here is the rationale of this logic:

1. Once we decide to `enforceProcessing`, we will continue enforcing until we 
got new data enqueued and all the buffer become full, in this case we will in 
`normalProcessing` state.
2. But we will update the `lastEnforcedProcessingTime` the last time we decide 
to start enforce processing.
3. We know that once we decide to enforce processing, we will always process 
immediately as there are indeed some data buffered already.

So the logic above sets `lastEnforcedProcessingTime` at the time we decide to 
"turn it on", and only "turn it off" during records enqueuing and all buffers 
contain some data. And hence we will first check `enforceProcessing`: if it is 
true we just continue enforce processing.

LGTY?

[ Full content available at: https://github.com/apache/kafka/pull/5428 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to