Skip to content

Conversation

huangzhen1997
Copy link
Contributor

@huangzhen1997 huangzhen1997 commented Oct 19, 2025

Fix concurrent write to the same map. Slack reference. Jira

@huangzhen1997 huangzhen1997 marked this pull request as ready for review October 19, 2025 15:37
@huangzhen1997 huangzhen1997 requested a review from a team as a code owner October 19, 2025 15:37
@Copilot Copilot AI review requested due to automatic review settings October 19, 2025 15:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds mutex locks to protect concurrent writes to shared maps in three view fetcher functions, preventing race conditions when multiple goroutines write to the same map simultaneously.

Key Changes:

  • Added sync.Mutex to synchronize concurrent map writes in parallel goroutine execution
  • Applied mutex locking pattern consistently across router, onramp, and fee quoter view functions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
deployment/view/router.go Added mutex protection for concurrent writes to onRampAddrMap
deployment/view/onramp.go Added mutex protection for concurrent writes to output map in fetchDestChainConfig
deployment/view/feequoter.go Added mutex protection for concurrent writes to output map in fetchDestChainConfigsView

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant