Skip to content

Commit

Permalink
[Reporting/ESQueue] data read/write failures are error logs (#45478)
Browse files Browse the repository at this point in the history
* [Reporting/ESQueue] data read/write failures are error logs

* fix warning level
  • Loading branch information
tsullivan authored Sep 13, 2019
1 parent 84a56d5 commit 9a56d42
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export class Worker extends events.EventEmitter {
this.checkSize = opts.size || 10;

this.debug = getLogger(opts, this.id, 'debug');
this.warn = getLogger(opts, this.id, 'warn');
this.warn = getLogger(opts, this.id, 'warning');
this.error = getLogger(opts, this.id, 'error');
this.info = getLogger(opts, this.id, 'info');

this._running = true;
Expand Down Expand Up @@ -205,7 +206,7 @@ export class Worker extends events.EventEmitter {
})
.catch((err) => {
if (err.statusCode === 409) return true;
this.warn(`_failJob failed to update job ${job._id}`, err);
this.error(`_failJob failed to update job ${job._id}`, err);
this.emit(constants.EVENT_WORKER_FAIL_UPDATE_ERROR, this._formatErrorParams(err, job));
return false;
});
Expand Down Expand Up @@ -297,7 +298,7 @@ export class Worker extends events.EventEmitter {
})
.catch((err) => {
if (err.statusCode === 409) return false;
this.warn(`Failure saving job output ${job._id}`, err);
this.error(`Failure saving job output ${job._id}`, err);
this.emit(constants.EVENT_WORKER_JOB_UPDATE_ERROR, this._formatErrorParams(err, job));
return this._failJob(job, (err.message) ? err.message : false);
});
Expand Down Expand Up @@ -382,7 +383,7 @@ export class Worker extends events.EventEmitter {
return this._performJob(claimedJob);
})
.catch((err) => {
this.warn('Error claiming jobs', err);
this.error('Error claiming jobs', err);
return Promise.reject(err);
});
}
Expand Down Expand Up @@ -436,7 +437,7 @@ export class Worker extends events.EventEmitter {
// ignore missing indices errors
if (err && err.status === 404) return [];

this.warn('job querying failed', err);
this.error('job querying failed', err);
this.emit(constants.EVENT_WORKER_JOB_SEARCH_ERROR, this._formatErrorParams(err));
throw err;
});
Expand Down

0 comments on commit 9a56d42

Please sign in to comment.