[PR #167] [CLOSED] Ensure thread safety by adding locking when processing listeners. #343

Closed
opened 2026-02-16 01:15:38 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/167
Author: @lingfengchencn
Created: 4/1/2025
Status: Closed

Base: mainHead: patch-1


📝 Commits (1)

  • f36b0d4 Fix: Avoid deadlock in plugin calls by adding locking when processing listeners to ensure thread safety.

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 internal/core/plugin_manager/local_runtime/stdio_handle.go (+3 -0)

📄 Description

Fix: fatal error: concurrent map iteration and map write

error info:

"/plugin/3ce9ade6-4593-4d7d-8171-e3eaee7f6a66/dispatch/model/schema"
plugin_daemon-1  | fatal error: concurrent map iteration and map write
plugin_daemon-1  | 
plugin_daemon-1  | goroutine 54 [running]:
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc00020a8d0, 0x24}, {0xc001b34558, 0x18, 0x18})
plugin_daemon-1  |      /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x105
plugin_daemon-1  | github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc000636919, 0x67, 0x0?}, {0x0, 0x0}, 0xc0011a9d38, 0xc0011a9d20, 0xc0011a9d10, 0xc0011a9d00)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-daemon/pull/167 **Author:** [@lingfengchencn](https://github.com/lingfengchencn) **Created:** 4/1/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`f36b0d4`](https://github.com/langgenius/dify-plugin-daemon/commit/f36b0d468beec7bb14f26668f5e0be46d769d069) Fix: Avoid deadlock in plugin calls by adding locking when processing listeners to ensure thread safety. ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/core/plugin_manager/local_runtime/stdio_handle.go` (+3 -0) </details> ### 📄 Description Fix: fatal error: concurrent map iteration and map write error info: ``` "/plugin/3ce9ade6-4593-4d7d-8171-e3eaee7f6a66/dispatch/model/schema" plugin_daemon-1 | fatal error: concurrent map iteration and map write plugin_daemon-1 | plugin_daemon-1 | goroutine 54 [running]: plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc00020a8d0, 0x24}, {0xc001b34558, 0x18, 0x18}) plugin_daemon-1 | /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x105 plugin_daemon-1 | github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc000636919, 0x67, 0x0?}, {0x0, 0x0}, 0xc0011a9d38, 0xc0011a9d20, 0xc0011a9d10, 0xc0011a9d00) ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:15:38 -05:00
yindo closed this issue 2026-02-16 01:15:38 -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#343