fix/connect-timeout-v2#4
Conversation
SeBsZ
commented
May 22, 2026
- Fixes check_tcp_responsiveness so it doesn't trigger excessive logging in MariaDB 10.4+ by switching from legacy fsockopen to mysqli_real_connect + mysql_close. Backwards compatible.
- MYSQLI_OPT_CONNECT_TIMEOUT force sets a timeout instead of falling back to the OS level TCP SYN retry - ~60s on linux
- More info about this: https://github.com/illogical-robot/apkmirror.com/issues/2376
…ing in MariaDB 10.4+ by switching from legacy fsockopen to mysqli_real_connect + mysql_close. Backwards compatible. - MYSQLI_OPT_CONNECT_TIMEOUT force sets a timeout instead of falling back to the OS level TCP SYN retry - ~60s on linux
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Code Review
This pull request enhances the database connection process by implementing per-database connection timeouts and improving the TCP responsiveness check. Specifically, it now uses mysqli_real_connect with credentials when available to avoid MariaDB authentication warnings and pre-auth abort errors. The review feedback identifies a compatibility issue where using \Throwable would break support for PHP versions prior to 7.0 and suggests using \Exception instead. Additionally, it was noted that the error suppression operator is used inconsistently across mysqli_options calls and should be removed for clarity.