Skip to content

Commit

Permalink
[DEBUG] add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerkesni committed Mar 3, 2025
1 parent 0a80325 commit e49f23b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion lib/BackbeatConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,10 @@ class BackbeatConsumer extends EventEmitter {
* @return {undefined}
*/
close(cb) {
this._log.debug('closing consumer', {

Check warning on line 1010 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1010

Added line #L1010 was not covered by tests
topic: this._topic,
groupId: this._groupId,
});
if (this._publishOffsetsCronTimer) {
clearInterval(this._publishOffsetsCronTimer);
this._publishOffsetsCronTimer = null;
Expand All @@ -1025,24 +1029,42 @@ class BackbeatConsumer extends EventEmitter {
// disconnecting, the rebalance callback will handle
// waiting for current jobs to complete as well as commit
// the latest offsets
this._log.debug('waiting for unassign', {

Check warning on line 1032 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1032

Added line #L1032 was not covered by tests
topic: this._topic,
groupId: this._groupId,
});
this.once('unassign', () => next());
return;
}
}
this._log.debug('no partitions assigned, disconnecting consumer', {

Check warning on line 1040 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1040

Added line #L1040 was not covered by tests
topic: this._topic,
groupId: this._groupId,
});
process.nextTick(next);
},
next => {
if (this._zookeeper) {
this._zookeeper.close();
}
if (this._consumer?.isConnected()) {
this._log.debug('disconnecting consumer', {

Check warning on line 1051 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1051

Added line #L1051 was not covered by tests
topic: this._topic,
groupId: this._groupId,
});
this._consumer.disconnect();
this._consumer.once('disconnected', () => next());
} else {
process.nextTick(next);
}
},
], () => cb());
], () => {
this._log.debug('backbeat consumer disconnected', {

Check warning on line 1062 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1062

Added line #L1062 was not covered by tests
topic: this._topic,
groupId: this._groupId,
});
cb();

Check warning on line 1066 in lib/BackbeatConsumer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

lib/BackbeatConsumer.js#L1066

Added line #L1066 was not covered by tests
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/queuePopulator/config/s3c-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}
},
"log": {
"logLevel": "info",
"logLevel": "debug",
"dumpLevel": "error"
},
"server": {
Expand Down

0 comments on commit e49f23b

Please sign in to comment.