mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
[PR #81] [MERGED] Fix: Convert shared class variables to instance variables to solve lock contention and CPU issues #128
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/81
Author: @hejuntt1014
Created: 4/8/2025
Status: ✅ Merged
Merged: 4/11/2025
Merged by: @Yeuoly
Base:
main← Head:fix-request-reader-shared-lock-and-list📝 Commits (1)
72fa55aFix: Convert shared class variables to instance variables in RequestReader to solve lock contention and CPU deadlock issues📊 Changes
4 files changed (+72 additions, -19 deletions)
View changed files
📝
python/dify_plugin/core/server/__base/request_reader.py(+66 -19)📝
python/dify_plugin/core/server/serverless/request_reader.py(+1 -0)📝
python/dify_plugin/core/server/stdio/request_reader.py(+3 -0)📝
python/dify_plugin/core/server/tcp/request_reader.py(+2 -0)📄 Description
Problem
In the RequestReader class, the lock and readers variables are defined as class variables shared by all instances, causing lock contention and high CPU usage issues in high-concurrency scenarios.
Fix
Testing
This fix resolves the CPU 100% usage and system deadlock issues that occurred in high-concurrency scenarios.
Modified Files
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.