From bb54696b87c43e939358564ef054b79eec614814 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 23 Jun 2022 10:47:34 +0200 Subject: [PATCH 1/3] add full detail about batchupdate --- lib/models/updateAction.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index 8b16e390..d00498cf 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -486,7 +486,7 @@ function doUpdateActionWithFilter(queryOptions, action, event, token, connection // If the error was reported by Orion, error.correlator will be // filled with the associated transaction id metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate); - logger.warn('error batchUpdate: %j', error); + logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', error, changes, event); alarm.raise(alarm.ORION, null, error); } ); // batchUpdate @@ -500,7 +500,7 @@ function doUpdateActionWithFilter(queryOptions, action, event, token, connection // If the error was reported by Orion, error.correlator will be // filled with the associated transaction id metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate); - logger.warn('error filtering %j', error); + logger.warn('error filtering %j with queryOptions: %j', error, queryOptions); alarm.raise(alarm.ORION, null, error); callback(error, null); } @@ -530,12 +530,14 @@ function doUpdateAction(action, event, token, connection, callback) { connection.v2.batchUpdate(changes).then( (response) => { // response.correlator transaction id associated with the server response + logger.info('response OK v2.batchUpdate entities: %j', response); metrics.IncMetrics(event.service, event.subservice, metrics.okActionEntityUpdate); alarm.release(alarm.ORION); callback(null, response); }, (error) => { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate); + logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', error, changes, event); alarm.raise(alarm.ORION, null, error); callback(error, null); } From 5163fc6517305cffbc797745f64f428a0b166245 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 23 Jun 2022 10:49:00 +0200 Subject: [PATCH 2/3] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index f2d5dd67..c98a005e 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ +- Add: full detail about batch update error or success in logs - Fix: expanding an object variable in action of rule (#692) - Fix: for EPL with context + insert + select rule (without expression) (#652) - Fix: format of internalCurrentTime fixed to ISO 8601 From 1cbd2e0af7521e751bc5c8e102dbe7fc5ef0228f Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Thu, 23 Jun 2022 10:52:08 +0200 Subject: [PATCH 3/3] fix linter --- lib/models/updateAction.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/models/updateAction.js b/lib/models/updateAction.js index d00498cf..dddd61c6 100644 --- a/lib/models/updateAction.js +++ b/lib/models/updateAction.js @@ -486,7 +486,8 @@ function doUpdateActionWithFilter(queryOptions, action, event, token, connection // If the error was reported by Orion, error.correlator will be // filled with the associated transaction id metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate); - logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', error, changes, event); + logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', + error, changes, event); alarm.raise(alarm.ORION, null, error); } ); // batchUpdate @@ -537,7 +538,8 @@ function doUpdateAction(action, event, token, connection, callback) { }, (error) => { metrics.IncMetrics(event.service, event.subservice, metrics.failedActionEntityUpdate); - logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', error, changes, event); + logger.warn('error v2.batchUpdate: %j trying update entity %j after event %j', + error, changes, event); alarm.raise(alarm.ORION, null, error); callback(error, null); }