From fd97ecc292d2c6e30d857baad3045549d9dccc88 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Thu, 29 Feb 2024 23:40:20 +0100 Subject: [PATCH 1/3] Add logs and reutrn Command when transaction queue is full --- .../common/epoch-check/blockchain-epoch-check-command.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js b/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js index b8eebc2008..2807d0da0a 100644 --- a/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js +++ b/src/commands/protocols/common/epoch-check/blockchain-epoch-check-command.js @@ -57,7 +57,14 @@ class BlockchainEpochCheckCommand extends Command { const transactionQueueLength = this.blockchainModuleManager.getTotalTransactionQueueLength(blockchain); - if (transactionQueueLength >= totalTransactions) return; + if (transactionQueueLength >= totalTransactions) { + this.logger.debug( + `Epoch check: Current transaction queue length is ${transactionQueueLength}, ` + + `exceeding the maximum total transactions: ${totalTransactions} for ${blockchain}` + + `with operation id: ${operationId}`, + ); + return Command.repeat(); + } totalTransactions -= transactionQueueLength; From e0074e644c157059b41190c7cd7e1026def9d736 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Fri, 1 Mar 2024 09:48:35 +0100 Subject: [PATCH 2/3] Version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 90f9944f5d..1bdb02af6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.2.2", + "version": "6.2.2+hotfix.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.2.2", + "version": "6.2.2+hotfix.2", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index 99fc299236..b23eb6d498 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.2.2", + "version": "6.2.2+hotfix.2", "description": "OTNode V6", "main": "index.js", "type": "module", From 341331cc969f6e5cb916d6306f81038ef8aee0b0 Mon Sep 17 00:00:00 2001 From: Djordje Kovacevic Date: Fri, 1 Mar 2024 09:53:35 +0100 Subject: [PATCH 3/3] Make sure that we are not schedulling more blockchain epoch check commands then we need --- src/commands/command-executor.js | 5 ++--- .../protocols/common/epoch-check/epoch-check-command.js | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/command-executor.js b/src/commands/command-executor.js index 5f2e36f057..e61b90ded3 100644 --- a/src/commands/command-executor.js +++ b/src/commands/command-executor.js @@ -233,7 +233,7 @@ class CommandExecutor { * @private */ async _addDefaultCommand(name) { - await this._delete(name); + await this.delete(name); const handler = this.commandResolver.resolve(name); if (!handler) { this.logger.warn(`Command '${name}' will not be executed.`); @@ -376,9 +376,8 @@ class CommandExecutor { * Delete command from database * @param name * @returns {Promise} - * @private */ - async _delete(name) { + async delete(name) { await this.repositoryModuleManager.destroyCommand(name); } diff --git a/src/commands/protocols/common/epoch-check/epoch-check-command.js b/src/commands/protocols/common/epoch-check/epoch-check-command.js index ca4f459b36..f839a22090 100644 --- a/src/commands/protocols/common/epoch-check/epoch-check-command.js +++ b/src/commands/protocols/common/epoch-check/epoch-check-command.js @@ -24,6 +24,8 @@ class EpochCheckCommand extends Command { `Epoch check: Starting epoch check command for operation id: ${operationId}`, ); + await this.commandExecutor.delete('blockchainEpochCheckCommand'); + await Promise.all( this.blockchainModuleManager.getImplementationNames().map(async (blockchain) => { const commandData = {