Skip to content

feat: /install/tasks support singleflight - #675

Merged
fatelei merged 1 commit into
langgenius:mainfrom
fatelei:issue-674
May 19, 2026
Merged

feat: /install/tasks support singleflight#675
fatelei merged 1 commit into
langgenius:mainfrom
fatelei:issue-674

Conversation

@fatelei

@fatelei fatelei commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Description

fix #674

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.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request go Pull requests that update go code labels Apr 3, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces request deduplication using the singleflight package for fetching plugin installation tasks, aimed at reducing redundant database queries. It also adds unit tests utilizing an in-memory SQLite database to verify the deduplication logic. The review feedback highlights critical concurrency concerns, specifically the risk of data races when returning shared pointers or slices to multiple concurrent callers, and suggests consolidating the separate singleflight groups into a single instance for better code organization.

Comment thread internal/service/install_task_service.go Outdated
Comment thread internal/service/install_task_service.go Outdated
Comment thread internal/service/install_task_service.go
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 19, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 19, 2026
@fatelei
fatelei merged commit 5ed6362 into langgenius:main May 19, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/install/tasks support singleflight

2 participants