[PR #565] [CLOSED] fix: concurrent map iteration and map write #586

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

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-daemon/pull/565
Author: @fatelei
Created: 1/10/2026
Status: Closed

Base: mainHead: issue-292


📝 Commits (1)

  • bcb86b9 fix: concurrent map iteration and map write

📊 Changes

6 files changed (+82 additions, -9 deletions)

View changed files

📝 pkg/utils/cache/helper/keys.go (+1 -1)
📝 pkg/utils/json_schema/gen.go (+7 -2)
pkg/utils/json_schema/validate.go (+29 -0)
pkg/utils/json_schema/validate_test.go (+41 -0)
📝 pkg/utils/mapping/sync.go (+1 -1)
📝 pkg/utils/mapping/sync_test.go (+3 -5)

📄 Description

Description

fix #292

because gojsonschema.NewGoLoader(schema), inside will use schema(map/slice) to do iteration, when share schema in mul goroutine will lead concurrent map iteration and map write

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.


🔄 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/565 **Author:** [@fatelei](https://github.com/fatelei) **Created:** 1/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `issue-292` --- ### 📝 Commits (1) - [`bcb86b9`](https://github.com/langgenius/dify-plugin-daemon/commit/bcb86b9b41478f27df04787ca96eef1c3d8fb3c0) fix: concurrent map iteration and map write ### 📊 Changes **6 files changed** (+82 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `pkg/utils/cache/helper/keys.go` (+1 -1) 📝 `pkg/utils/json_schema/gen.go` (+7 -2) ➕ `pkg/utils/json_schema/validate.go` (+29 -0) ➕ `pkg/utils/json_schema/validate_test.go` (+41 -0) 📝 `pkg/utils/mapping/sync.go` (+1 -1) 📝 `pkg/utils/mapping/sync_test.go` (+3 -5) </details> ### 📄 Description ## Description fix #292 because gojsonschema.NewGoLoader(schema), inside will use schema(map/slice) to do iteration, when share schema in mul goroutine will lead concurrent map iteration and map write ## Type of Change - [x] Bug fix - [ ] New feature - [ ] Refactor - [ ] Performance improvement - [ ] Other ## Essential Checklist ### Testing - [x] I have tested the changes locally and confirmed they work as expected - [x] I have added unit tests where necessary and they pass successfully ### Bug Fix (if applicable) - [x] I have used GitHub syntax to close the related issue (e.g., `Fixes #123` or `Closes #123`) ## Additional Information Please provide any additional context that would help reviewers understand the changes. --- <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:16:24 -05:00
yindo closed this issue 2026-02-16 01:16:24 -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#586