Skip to content

Commit

Permalink
Fix issue where a commit could yield a result breaking connect async.…
Browse files Browse the repository at this point in the history
…waterfall (#918)
  • Loading branch information
hyperlink committed Apr 9, 2018
1 parent 5bd3d76 commit 5b11858
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/consumerGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,19 @@ ConsumerGroup.prototype.connect = function () {
self.options.onRebalance(self.generationId != null && self.memberId != null, callback);
return;
}
callback();
callback(null);
},
function (callback) {
if (self.options.autoCommit && self.generationId != null && self.memberId) {
self.commit(true, callback);
self.commit(true, function (error) {
if (error) {
return callback(error);
}
callback(null);
});
return;
}
callback();
callback(null);
},
function (callback) {
if (self.client.coordinatorId) {
Expand Down

1 comment on commit 5b11858

@aikar
Copy link
Contributor

@aikar aikar commented on 5b11858 Apr 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hyperlink you didn't wrap the callback for onRebalance here.

Please sign in to comment.