Skip to content

Commit

Permalink
Merge branch 'w/8.5/bugfix/BB-624-connection-retry' into w/8.6/bugfix/B…
Browse files Browse the repository at this point in the history
…B-624-connection-retry
  • Loading branch information
BourgoisMickael committed Nov 6, 2024
2 parents 0a32e66 + 16abf3c commit d76c0af
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/queuePopulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const queuePopulator = new QueuePopulator(zkConfig, kafkaConfig,
qpConfig, httpsConfig, mConfig, rConfig, vConfig, extConfigs);

async.waterfall([
done => queuePopulator.open(done),

Check warning on line 53 in bin/queuePopulator.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

bin/queuePopulator.js#L53

Added line #L53 was not covered by tests
done => startProbeServer(qpConfig.probeServer, (err, probeServer) => {
if (err) {
log.error('error starting probe server', {
Expand All @@ -69,7 +70,6 @@ async.waterfall([
}
done();
}),
done => queuePopulator.open(done),
done => {
const taskState = {
batchInProgress: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ class KafkaNotificationDestination extends NotificationDestination {
this._log.info('error setting up kafka notif destination',
{ error: err.message });
done(err);
} else {
done();

Check warning on line 83 in extensions/notification/destination/KafkaNotificationDestination.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

extensions/notification/destination/KafkaNotificationDestination.js#L83

Added line #L83 was not covered by tests
}
done();
});
}

Expand Down
6 changes: 4 additions & 2 deletions extensions/notification/queueProcessor/QueueProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ class QueueProcessor extends EventEmitter {
async.series([
next => this._setupNotificationConfigManager(next),
next => this._setupDestination(this.destinationConfig.type, next),
next => this._destination.init(() => {
// if connection to destination fails, process will stop & restart
next => this._destination.init(next),

Check warning on line 147 in extensions/notification/queueProcessor/QueueProcessor.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

extensions/notification/queueProcessor/QueueProcessor.js#L147

Added line #L147 was not covered by tests
next => {
if (options && options.disableConsumer) {
this.emit('ready');
return next();
Expand Down Expand Up @@ -183,7 +185,7 @@ class QueueProcessor extends EventEmitter {
this._getConfig = util.callbackify(this.bnConfigManager
.getConfig.bind(this.bnConfigManager));
return undefined;
}),
},
], err => {
if (err) {
this.logger.error('error starting notification queue processor',
Expand Down
2 changes: 1 addition & 1 deletion extensions/replication/failedCRR/FailedCRRProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class FailedCRRProducer {
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
this._producer.once('error', () => {});
this._producer.once('error', cb);
this._producer.once('ready', () => {
this._producer.removeAllListeners('error');
this._producer.on('error', err =>
Expand Down
2 changes: 1 addition & 1 deletion extensions/replication/replay/ReplayProducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ReplayProducer {
maxRequestSize: this._kafkaConfig.maxRequestSize,
topic: this._topic,
});
this._producer.once('error', () => {});
this._producer.once('error', cb);

Check warning on line 33 in extensions/replication/replay/ReplayProducer.js

View check run for this annotation

Codecov / codecov/patch/Backbeat

extensions/replication/replay/ReplayProducer.js#L33

Added line #L33 was not covered by tests
this._producer.once('ready', () => {
this._producer.removeAllListeners('error');
this._producer.on('error', err =>
Expand Down
16 changes: 13 additions & 3 deletions images/nodesvc-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ RUN yarn cache clean \
&& yarn install --production --frozen-lockfile --ignore-optional --ignore-engines --network-concurrency 1 \
&& yarn cache clean

# Somehow chown in another layer will replace some node_modules built symlink with copy of file
# To keep the same output as previously
RUN chown -R ${USER} /tmp/build/node_modules

################################################################################
FROM ghcr.io/scality/federation/nodesvc-base:7.10.7.0

WORKDIR ${HOME_DIR}/backbeat
RUN chown -R ${USER} ${HOME_DIR}/backbeat

COPY . ${HOME_DIR}/backbeat
COPY --from=builder /tmp/build/node_modules ./node_modules/
# Keep same output as chown command without group (use group 0)
COPY --chown=${USER}:0 . ${HOME_DIR}/backbeat
COPY --from=builder --chown=${USER}:0 /tmp/build/node_modules ./node_modules/

RUN chown -R ${USER} ${HOME_DIR}/backbeat
# All copied files are already chowned scality(1000):root(0)
# This removes a 763MB layer. Image goes from 2.34GB to 1.55GB
# Besides S3C Federation will chown scality(1001):scality(1001) at poststart
# TODO S3C-9479: Images will be reworked for size optimization
# RUN chown -R ${USER} ${HOME_DIR}/backbeat

USER ${USER}

Expand Down

0 comments on commit d76c0af

Please sign in to comment.