From 9a56d426ed15928244e5d407a0531319a1c9c516 Mon Sep 17 00:00:00 2001 From: Tim Sullivan Date: Fri, 13 Sep 2019 11:39:31 -0700 Subject: [PATCH] [Reporting/ESQueue] data read/write failures are error logs (#45478) * [Reporting/ESQueue] data read/write failures are error logs * fix warning level --- .../plugins/reporting/server/lib/esqueue/worker.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js b/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js index 0e2f681f9b418..1a1fa78111852 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js +++ b/x-pack/legacy/plugins/reporting/server/lib/esqueue/worker.js @@ -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; @@ -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; }); @@ -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); }); @@ -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); }); } @@ -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; });