Bug #118568 MySQL Router blocks Client IP When Using Telnet for Port Liveness Checks
Submitted: 1 Jul 7:45 Modified: 10 Jul 15:52
Reporter: JL LIU Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Router Severity:S2 (Serious)
Version: OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: Liveness check, MySQL Router, telnet

[1 Jul 7:45] JL LIU
Description:
When using the telnet command to check MySQL Router's liveness, the Router will block the client after a specific number of connection attempts.

​​Root Cause:​​ 
Router likely increments a max_connect_errors counter for each failed/unfinished connection (common with telnet). Upon hitting the threshold, it invokes system firewall tools to add blocking rules. This approach is overly aggressive and inappropriate for application-layer issues.

Expected Behavior:​​
Low-frequency health checks should ​​not​​ trigger IP isolation.

How to repeat:
Steps to Reproduce (I set max_connect_errors to 10 to quick reproduce it):​​

1. Start a MySQL Router instance on a server (Server_A). The routing config is like this:
    [routing:30000]
    bind_address = 0.0.0.0
    bind_port = 30000
    destinations = 9.135.59.11:3306
    routing_strategy = first-available
    max_connect_errors = 10

2. telnet <Router_IP> 30000 . And quit the connection.
3. check log. We can find log below:
2025-07-01 14:54:36 routing INFO [7fb2aeffd700] [routing:30000] incrementing error counter for host of 9.134.224.84:41118 (now 1)
2025-07-01 14:54:37 routing INFO [7fb2e71db700] [routing:30000] incrementing error counter for host of 9.134.224.84:41154 (now 2)
2025-07-01 14:54:38 routing INFO [7fb2e69da700] [routing:30000] incrementing error counter for host of 9.134.224.84:41174 (now 3)
2025-07-01 14:54:39 routing INFO [7fb2e61b8700] [routing:30000] incrementing error counter for host of 9.134.224.84:41200 (now 4)
2025-07-01 14:54:40 routing INFO [7fb2e59b7700] [routing:30000] incrementing error counter for host of 9.134.224.84:41224 (now 5)
2025-07-01 14:54:41 routing INFO [7fb2e51b6700] [routing:30000] incrementing error counter for host of 9.134.224.84:41246 (now 6)
2025-07-01 14:54:42 routing INFO [7fb2e4994700] [routing:30000] incrementing error counter for host of 9.134.224.84:41276 (now 7)
2025-07-01 14:54:43 routing INFO [7fb2d3fff700] [routing:30000] incrementing error counter for host of 9.134.224.84:41312 (now 8)
2025-07-01 14:54:44 routing INFO [7fb2d37fe700] [routing:30000] incrementing error counter for host of 9.134.224.84:41326 (now 9)
2025-07-01 14:54:45 routing WARNING [7fb2d2ffd700] [routing:30000] blocking client host for 9.134.224.84:41348

Suggested fix:
Provide a config to close this rule.
[1 Jul 7:48] JL LIU
I need to send a warning when router was down.
[10 Jul 15:52] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

For details on getting support for MySQL products see http://www.mysql.com/support/
You can also check our forums (free) at http://forums.mysql.com/

Thank you for your interest in MySQL.