[MXS-967] setting connection_timeout=value cause error : Not a boolean value Created: 2016-11-14  Updated: 2016-11-14  Resolved: 2016-11-14

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: 2.0.0
Fix Version/s: 2.0.2

Type: Bug Priority: Critical
Reporter: Richard Stracke Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

reproduced on RHE and Ubunte



 Description   

connection_timeout parameter is defined as

"To enable them, define the timeout in seconds in the service's configuration section."

https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale-configuration-usage-scenarios/#connection_timeout

But the setter use function config_truth_value() to check the parameter, but
config_truth_value returns an error("Not a boolean value"), if the value is unequal 0 or 1.

serviceSetTimeout(service, config_truth_value(connection_timeout));

config_truth_value(char *str)
{
if (strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0 ||
strcasecmp(str, "yes") == 0 || strcasecmp(str, "1") == 0)

{ return 1; }

if (strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0 ||
strcasecmp(str, "no") == 0 || strcasecmp(str, "0") == 0)

{ return 0; }

MXS_ERROR("Not a boolean value: %s", str);
return -1;
To reproduce:
add
connection_timeout=3600
to a services configuration.

Suggested fix:

remove function config_truth_value

serviceSetTimeout(service, connection_timeout);



 Comments   
Comment by markus makela [ 2016-11-14 ]

On the 2.0 branch, this seems to only happen with the reload config command.

Comment by markus makela [ 2016-11-14 ]

The parameter is now correctly processed in configuration reloads.

Generated at Thu Feb 08 04:03:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.