FreeOnePlus opened a new pull request, #9: URL: https://github.com/apache/doris-mcp-server/pull/9
issue: #8 According to the log performance of multiple users, this problem may mainly exist in the connection pool when it is created. Connections with abnormal status may be generated. These abnormal connections will remain in the pool until they are used. When aiomysql.create_pool() is called, it will immediately try to create minsize=5 connections. During this pre-creation process, the following situations will cause the connection's _reader object to be abnormal: 1. When the MySQL server is under high load or the network is unstable, internal state inconsistency may occur when the TCP connection has been established but the MySQL protocol handshake has not yet been completed 2. aiomysql is based on asyncio's StreamReader/StreamWriter. When the network is jittery, _reader may be accidentally set to None. Concurrent connection creation during connection pool initialization may cause incomplete internal states of some connections 3. This is especially likely to occur in Docker environments or network proxy environments. Based on the root cause of the problem, the following adjustments were made: 1. Reduce the number of pre-created connections: set minsize to 0 or 1 2. Strengthen connection verification: perform stricter health checks immediately after obtaining a connection 3. Implement delayed connection creation: create connections on demand instead of pre-creating 4. Add a retry mechanism: automatically retry when connection acquisition fails -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
