Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

healthcheck correct connect result #612

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

grooverdan
Copy link
Member

Based on user reports, a connect test can observer a non-"Can't connect" error message.

Because this passes other tests, like innodb_initialized might succeeded.

The final test -z "$connect_s" is also true, leaving the user with an incorrect test result.

Maybe the .my-healthcheck cnf isn't fully written yet?

+ mariadb --defaults-extra-file=/var/lib/mysql/.my-healthcheck.cnf --skip-ssl --skip-ssl-verify-server-cert -h localhost --protocol tcp -e 'select 1'
+ grep -qF 'Can'\''t connect'
+ local ret=1
+ set -eo pipefail
+ ((  1 == 0  ))
+ connect_s=0
+ return 0
+ test=
+ shift
+ '[' 1 -gt 0 ']'
+ case "$1" in
+ test=innodb_initialized
+ '[' -n innodb_initialized ']'

Either way, ruggardize the final test to ensure a healthy connect test occurred.

Closes #610

Based on user reports, a `connect` test can observer a non-"Can't
connect" error message.

Because this passes other tests, like innodb_initialized might
succeeded.

The final test -z "$connect_s" is also true, leaving the user
with an incorrect test result.

Maybe the healthcheck cnf hasn't been created yet?

Either way, ruggardise the final test to ensure a healthy connect
test occured.

Narrow down the scope of healthcheck --connect failures
to the mariadb client errors "Can't connect".

May as well look at same @skip-networking system variable
on TCP just in case.

28000 errors, per
https://mariadb.com/kb/en/mariadb-error-code-reference/ are client
errors after a connection, indicating that the start of a tcp
connection occured.

Closes MariaDB#610
@grooverdan grooverdan merged commit e808524 into MariaDB:master Sep 3, 2024
15 checks passed
@grooverdan grooverdan deleted the health_check_false_connect branch September 3, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Healthcheck indicates healthy before processing docker-entrypoint-initdb.d
1 participant