You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introducing granular command timeouts global setting (#9659)
* Introducing granular command timeouts global setting
* fix marvin tests
* Fixed log messages
* some more log message fix
* Fix empty value setting
* Converted the global setting to non-dynamic
* set wait on command only when granular wait is defined. This is to keep the backward compatibility
* Improve error logging
"This timeout overrides the wait global config. This holds a comma separated key value pairs containing timeout (in seconds) for specific commands. " +
logger.info(String.format("Timeouts for management server internal commands successfully initialized from global setting commands.timeout: %s", _commandTimeouts));
logger.error(String.format("Initialising the timeouts using commands.timeout: %s for management server internal commands failed with error %s", commandPair, e.getMessage()));
479
+
}
480
+
} else {
481
+
logger.error(String.format("Error initialising the timeouts for management server internal commands. Invalid format in commands.timeout: %s", commandPair));
logger.debug(String.format("Checking the wait time in seconds to be used for the following commands : %s. If there are multiple commands sent at once," +
1068
+
"then max wait time of those will be used", cmds));
1069
+
}
1070
+
1000
1071
for (finalCommandcmd : cmds) {
1001
1072
if (cmd.getWait() > wait) {
1002
1073
wait = cmd.getWait();
@@ -1821,7 +1892,7 @@ public String getConfigComponentName() {
StringerrorMessage = String.format("Validation failed: Command '%s' does not contain '='.", command);
1413
+
returnnewPair<>(false, errorMessage);
1414
+
}
1415
+
1416
+
String[] parts = command.split("=");
1417
+
if (parts.length != 2) {
1418
+
StringerrorMessage = String.format("Validation failed: Command '%s' is not properly formatted.", command);
1419
+
returnnewPair<>(false, errorMessage);
1420
+
}
1421
+
1422
+
StringcommandName = parts[0].trim();
1423
+
StringvalueString = parts[1].trim();
1424
+
1425
+
if (commandName.isEmpty()) {
1426
+
StringerrorMessage = String.format("Validation failed: Command name is missing in '%s'.", command);
1427
+
returnnewPair<>(false, errorMessage);
1428
+
}
1429
+
1430
+
try {
1431
+
intnum = Integer.parseInt(valueString);
1432
+
if (num <= 0) {
1433
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not greater than 0. Invalid value: %d", commandName, num);
1434
+
returnnewPair<>(false, errorMessage);
1435
+
}
1436
+
} catch (NumberFormatExceptione) {
1437
+
StringerrorMessage = String.format("Validation failed: The value for command '%s' is not a valid integer. Invalid value: %s", commandName, valueString);
1438
+
returnnewPair<>(false, errorMessage);
1439
+
}
1440
+
}
1441
+
}
1442
+
1443
+
returnnewPair<>(true, "");
1444
+
} catch (Exceptione) {
1445
+
StringerrorMessage = String.format("Validation failed: An error occurred while parsing the command string. Error: %s", e.getMessage());
1446
+
returnnewPair<>(false, errorMessage);
1447
+
}
1448
+
}
1449
+
1376
1450
/**
1377
1451
* Returns a boolean indicating whether a Config's range should be validated. It should not be validated when:</br>
0 commit comments