Skip to content

[BUG] Loop query db in func batchGetCache2 #3301

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

Open
xuzhijvn opened this issue Apr 24, 2025 · 0 comments · May be fixed by #3302
Open

[BUG] Loop query db in func batchGetCache2 #3301

xuzhijvn opened this issue Apr 24, 2025 · 0 comments · May be fixed by #3302
Assignees
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@xuzhijvn
Copy link

OpenIM Server Version

v3.8.3-patch.4

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

Func batchGetCache2 (pkg/common/storage/cache/redis/batch.go) has a bug in loop querying the database:

  1. If a large amount of data is fetched each time (e.g., loading 200 messages at once), the loop querying the database may cause long delays.
  2. If the concurrency is high, it can easily overload the DB.

Tips: RocksCache’s default empty expiration is 60s, so many empty results may penetrate to the DB.

Screenshots Link

Image
@xuzhijvn xuzhijvn added the bug Categorizes issue or PR as related to a bug. label Apr 24, 2025
xuzhijvn pushed a commit to xuzhijvn/open-im-server that referenced this issue Apr 24, 2025
xuzhijvn added a commit to xuzhijvn/open-im-server that referenced this issue Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants