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

[Bug] [connection] If it runs for a long time, there is a problem that the connection pool leaks and causes inaccessibility. #2043

Open
2 of 15 tasks
Andy1i opened this issue Sep 24, 2024 · 0 comments
Labels
bug Something isn't working Waiting for reply

Comments

@Andy1i
Copy link

Andy1i commented Sep 24, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

Linux

Python version information

=3.11

DB-GPT version

main

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

cpu: 16c 32g

Models information

default

What happened

  1. 使用 get_raw_session 时, 大部分使用没有主动释放session, 导致连接池长时间占用
  2. RDBMSConnector 类使用 self.session 或者 self._db_sessions 时,未进行主动释放, 导致连接被长时间占用

What you expected to happen

使用上述两个方法时, 是否需要主动释放session, 或者使用上下文 with来关联session, 避免造成session资源的浪费或泄露

How to reproduce

  1. 将系统连接池变小
  • LOCAL_DB_POOL_SIZE=2
  • LOCAL_DB_POOL_OVERFLOW=0
  1. 将数据库连接时连接池变小进行测试

image

Additional context

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@Andy1i Andy1i added bug Something isn't working Waiting for reply labels Sep 24, 2024
@Aries-ckt Aries-ckt changed the title [Bug] [connection] 长时间运行,存在连接池泄露导致无法访问的问题 [Bug] [connection] If it runs for a long time, there is a problem that the connection pool leaks and causes inaccessibility. Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

No branches or pull requests

1 participant