Lock in func LaunchPlugin is released too early #186

Closed
opened 2026-02-16 00:20:23 -05:00 by yindo · 0 comments
Owner

Originally created by @wylswz on GitHub (Sep 11, 2025).

Originally assigned to: @wylswz on GitHub.

Self Checks

To make sure we get to you in time, please check the following :)

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • "Please do not modify this template :) and fill in all the required fields."

Versions

  1. dify-plugin-daemon (0.2.0)
  2. dify-api (1.8.1)

Describe the bug
When multiple workspaces launch the same plugin simultaneously, the serverless connector receives multiple requests.

The lock is released in a defer statement, while func LaunchPlugin() returns a stream. The expected behavior should be releasing the lock if

  • Current function fails somewhere after the lock is required.
  • Or the stream finishes.

To Reproduce

  • Install a plugin from one workspace
  • Switch to another workspace and install the same plugin again

Expected behavior
Only one plugin runtime is installed if multiple workspaces lauches plugin simultaneously

Screenshots

Additional context

Originally created by @wylswz on GitHub (Sep 11, 2025). Originally assigned to: @wylswz on GitHub. **Self Checks** To make sure we get to you in time, please check the following :) - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-plugin-daemon/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] "Please do not modify this template :) and fill in all the required fields." **Versions** 1. dify-plugin-daemon (0.2.0) 2. dify-api (1.8.1) **Describe the bug** When multiple workspaces launch the same plugin simultaneously, the serverless connector receives multiple requests. The lock is released in a defer statement, while `func LaunchPlugin()` returns a stream. The expected behavior should be releasing the lock if - Current function fails somewhere after the lock is required. - Or the stream finishes. **To Reproduce** - Install a plugin from one workspace - Switch to another workspace and install the same plugin again **Expected behavior** Only one plugin runtime is installed if multiple workspaces lauches plugin simultaneously **Screenshots** **Additional context**
yindo closed this issue 2026-02-16 00:20:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-daemon#186