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

Refactor the connection pool #7

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Refactor the connection pool #7

wants to merge 6 commits into from

Conversation

W0n9
Copy link
Contributor

@W0n9 W0n9 commented Dec 13, 2024

Found some issues in the staging environment:

  1. Under high load, occasional deadlocks occur, causing the program to fail to respond normally, and user requests are backlogged in the buffer.
    微信截图_20241210000852
    Solution:
  2. Introduce a new dynamically expandable connection pool, replacing the existing pre-filled connection pool, attempting to solving the deadlock problem existing in the old connection pool.
  3. Introduce the testing of req.Body() to avoid req.Body() being cleared.
  4. Upgrade the version of xerrors.

在预发环境中发现一些问题:

  1. 高负载下偶发死锁,导致程序无法正常响应,用户请求积压在缓冲区
    微信截图_20241210000852

解决方案:

  1. 引入新的动态扩展的连接池,代替现有的预填充的连接池,同时解决了现有连接池存在的死锁问题
  2. 增加对req.Body()的测试,避免req.Body()被清空
  3. 升级xerrors版本

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.

1 participant