Open
Description
The end of the method comment appears to be wrong. It says:
// In the polling case (not channel based consumer) the rebalance event
// is returned in retval, else nil is returned.
While the code actually returns a non-nil
event only in the channel case, which is the exact opposite of the comment.
- lines 1022-1025: creates
ev
if there is arebalanceCb
orappRebalanceEnable
- lines 1029-1034 : returns it if
channel != nil && c.appRebalanceEnable && c.rebalanceCb == nil
which is the opposite of the documentation - line 1046: return
nil
if there is arebalanceCb
and it calledAssign/Unassign
- line 1088: return nil unconditionally
It seems that:
-
either the doc should read like this instead:
// In the polling case (not channel based consumer) the rebalance event // is passed to the `rebalanceCb` if it is set, and never returned to `eventPoll`
-
or the function logic should be amended to match the comment and allow the method to return the event to
eventPoll
.
The latter would provide most consistent handling, but would make it easier for callers to introduce bugs in their code because then the protection logic built when calling rebalanceCb
would have no equivalent for the processing in eventPoll
.
Do you want a PR either way ?
Metadata
Metadata
Assignees
Labels
No labels