Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-967

setting connection_timeout=value cause error : Not a boolean value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 2.0.0
    • 2.0.2
    • N/A
    • None
    • 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);

      Attachments

        Activity

          People

            markus makela markus makela
            Richard Richard Stracke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.