Skip to content

fix(solver/rebalance): fix chain mutexes #4187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025
Merged

fix(solver/rebalance): fix chain mutexes #4187

merged 2 commits into from
Jun 4, 2025

Conversation

kevinhalliday
Copy link
Contributor

Fix chain mutexes, avoid deadlocks.

issue: none

@kevinhalliday kevinhalliday requested a review from corverroos June 4, 2025 03:49
if mu, ok := chainMutexes[chainID]; ok {
mu.Unlock()
}
m, ok := chainMutexes[chainID]
Copy link
Collaborator

Choose a reason for hiding this comment

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

can replace this with slighly more readable:

var mutexes sync.Map

func getMutex(chainID uint64) *sync.Mutex {
  return m.LoadOrStore(chainID, new(sync.Mutex)).(*sync.Mutex)
}

@corverroos corverroos enabled auto-merge (squash) June 4, 2025 08:35
@corverroos corverroos merged commit d025f92 into main Jun 4, 2025
22 checks passed
@corverroos corverroos deleted the kh/fix-chain-mu branch June 4, 2025 08:44
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.

3 participants