Plugin daemon: concurrent map iteration and map write #10001

Closed
opened 2026-02-21 18:41:33 -05:00 by yindo · 0 comments
Owner

Originally created by @dfxbb on GitHub (Mar 9, 2025).

Originally assigned to: @Yeuoly on GitHub.

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Plugin daemon crashes with following info, and models became unavailable for several minutes.

[GIN] 2025/03/09 - 12:22:52 | 200 |   32.711523ms |      172.18.0.9 | POST     "/plugin/c1e6d088-b785-4099-8945-318e333d9e33/dispatch/model/schema"
fatal error: concurrent map iteration and map write

goroutine 58 [running]:
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc001844030, 0x24}, {0xc001a4f000, 0xe79, 0x1000})
        /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x111
github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc0009b5d35, 0xec8, 0x40956c?}, {0x0, 0x0}, 0xc001459d38, 0xc001459d20, 0xc001459d10, 0xc001459d00)
        /app/pkg/entities/plugin_entities/event.go:54 +0x515
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc000904270, 0x16713f8)
        /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:93 +0x273
github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3()
        /app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820270?, 0xc00025ab40?})
        /app/internal/utils/routine/pool.go:58 +0x34
runtime/pprof.Do({0x18200c0?, 0x22c9d60?}, {{0xc000714100?, 0x1617908?, 0x138dbc0?}}, 0xc0005e2f00)
        /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1()
        /app/internal/utils/routine/pool.go:56 +0x394
github.com/panjf2000/ants.(*goWorker).run.func1()
        /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d
created by github.com/panjf2000/ants.(*goWorker).run in goroutine 57
        /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c

Full report attached below:

plugin-crash.txt

✔️ Expected Behavior

not crashing

Actual Behavior

crashed

Originally created by @dfxbb on GitHub (Mar 9, 2025). Originally assigned to: @Yeuoly on GitHub. ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/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. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ``` Plugin daemon crashes with following info, and models became unavailable for several minutes. [GIN] 2025/03/09 - 12:22:52 | 200 | 32.711523ms | 172.18.0.9 | POST "/plugin/c1e6d088-b785-4099-8945-318e333d9e33/dispatch/model/schema" fatal error: concurrent map iteration and map write goroutine 58 [running]: github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout.func1({0xc001844030, 0x24}, {0xc001a4f000, 0xe79, 0x1000}) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:100 +0x111 github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities.ParsePluginUniversalEvent({0xc0009b5d35, 0xec8, 0x40956c?}, {0x0, 0x0}, 0xc001459d38, 0xc001459d20, 0xc001459d10, 0xc001459d00) /app/pkg/entities/plugin_entities/event.go:54 +0x515 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*stdioHolder).StartStdout(0xc000904270, 0x16713f8) /app/internal/core/plugin_manager/local_runtime/stdio_handle.go:93 +0x273 github.com/langgenius/dify-plugin-daemon/internal/core/plugin_manager/local_runtime.(*LocalPluginRuntime).StartPlugin.func3() /app/internal/core/plugin_manager/local_runtime/run.go:160 +0x57 github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1.1({0x1820270?, 0xc00025ab40?}) /app/internal/utils/routine/pool.go:58 +0x34 runtime/pprof.Do({0x18200c0?, 0x22c9d60?}, {{0xc000714100?, 0x1617908?, 0x138dbc0?}}, 0xc0005e2f00) /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d github.com/langgenius/dify-plugin-daemon/internal/utils/routine.Submit.func1() /app/internal/utils/routine/pool.go:56 +0x394 github.com/panjf2000/ants.(*goWorker).run.func1() /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:71 +0x8d created by github.com/panjf2000/ants.(*goWorker).run in goroutine 57 /go/pkg/mod/github.com/panjf2000/ants@v1.3.0/worker.go:49 +0x5c ``` Full report attached below: [plugin-crash.txt](https://github.com/user-attachments/files/19153423/plugin-crash.txt) ### ✔️ Expected Behavior not crashing ### ❌ Actual Behavior crashed
yindo added the 🐞 bug label 2026-02-21 18:41:33 -05:00
yindo closed this issue 2026-02-21 18:41:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#10001