Skip to content
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

fix(thorchain/utxo): fix race conditions #1281

Merged
merged 5 commits into from
Oct 8, 2024
Merged

Conversation

misko9
Copy link
Contributor

@misko9 misko9 commented Oct 2, 2024

Fixes a few race conditions on thorchain and utxo chains.

Thorchain: sidecar processes now get their own copy of env list so they can make runtime changes in parallel.

Utxo: reading and writing KeynameToWalletMap and AddrToKeynameMap is now protected by a mutex. The block producing go routine is now ran after faucet creation and a utxo stop method is added for the test framework to cancel its context.

Thorchain's setup_test.go is updated to call the utxo chain's stop method. This will also be reflected in the thornode v50 branch.

@misko9 misko9 requested a review from a team as a code owner October 2, 2024 20:39
Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
interchaintest-docs ⬜️ Ignored (Inspect) Visit Preview Oct 7, 2024 9:36pm

@misko9 misko9 requested a review from agouin October 2, 2024 20:40
@jtieri
Copy link
Member

jtieri commented Oct 6, 2024

I wanted to give you a heads up, #1270 introduces some changes that are going to affect the thorchain/utxo stuff you are working on. I just finished linting the codebase and re-adding the linter as a required status check in CI and one major change I needed to make was passing in a context to the Thorchain API calls so that context cancellation is respected

Comment on lines +59 to +64
for _, chain := range chains {
utxoChain, ok := chain.(*utxo.UtxoChain)
if ok {
utxoChain.Stop()
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but if this always needs to be called it may make sense to move into the ic.Close() func?

@Reecepbcups Reecepbcups merged commit 4490028 into main Oct 8, 2024
20 checks passed
@Reecepbcups Reecepbcups deleted the steve/thorchain-utxo-race branch October 8, 2024 01:52
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