Not sure I follow your comment here.. let me elaborate a bit on my logic:

We have two commits in places: commitAll (periodic) and maybeCommit (for user 
requested):

The latter checks

```
if (task.commitRequested() && task.commitNeeded()) 
                    task.commit();
```

While the former only checks:

```
if (task.commitNeeded()) 
                    task.commit();
```

I.e. the logic for the latter is that "only if user have requested, and it is 
indeed needed to commit": for example, if we have actually committed from the 
commit interval, and then user requested it as well, the second will be omitted.

I intentionally separated "commitRequest" (this is only set by user) and 
"commitNeeded" (this is determined by the library) because this way looks 
cleaner to me.

[ 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