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

db: Make db:State self-healing on invalid connection (timeouts) #6568

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

zach2good
Copy link
Contributor

@zach2good zach2good commented Dec 20, 2024

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

connection->reconnect() seemingly doesn't work. But ->isValid() wraps mysql_ping, so it's a good indicator of if the connection is going to work or not. We now rebuild the connection completely if isValid() fails.

@zach2good zach2good changed the title db: Construct underlying sql::Connection with sql::Properties and opt… db: Use isValid(int32_t timeout) instead of isValid(void) Dec 20, 2024
@zach2good zach2good changed the title db: Use isValid(int32_t timeout) instead of isValid(void) db: Make db:State self-healing on invalid connection (timeouts) Dec 20, 2024
@zach2good zach2good marked this pull request as ready for review December 20, 2024 17:29
@zach2good zach2good mentioned this pull request Dec 20, 2024
4 tasks
@zach2good
Copy link
Contributor Author

Tested by stripping out the ping job that was in there so that it doesn't try to reconnect and pings every 5s. Then restarting my MariaDB service repeatedly and see the new logging for "rebuilding connection" instead of the pings failing because ->reconnect() doesn't do what it promises

@zach2good zach2good merged commit 96e822c into base Dec 20, 2024
12 checks passed
@zach2good zach2good deleted the sql_properties branch December 20, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants