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
Add concurrency safeguards to the current round timeout field on chain #1342
Add concurrency safeguards to the current round timeout field on chain #1342
Conversation
the problem here is that tii reference escapes from generate block and most likely is used concurrently in this closure. It is set to handler and func txnIterHandlerFunc(mc *Chain,
b *block.Block,
lfb *block.Block,
bState util.MerklePatriciaTrieI,
txnProcessor txnProcessorHandler,
tii *TxnIterInfo) func(context.Context, datastore.CollectionEntity) bool {
return func(ctx context.Context, qe datastore.CollectionEntity) bool { and handler lately is passed to iterate collection where it can be used concurrently err := transactionEntityMetadata.GetStore().IterateCollection(cctx, transactionEntityMetadata, collectionName, txnIterHandler) please check all tii reference sharing between go routines |
I got it. Only now, I realize tii escapes to |
please fix lint error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Fixes
Add concurrency safeguards to the current round timeout field on chain (#629)
Also, add concurrency safeguards to the transaction cost as the processing of transactions may be done concurrently.
Changes
Need to be mentioned in CHANGELOG.md?
Tests
Tasks to complete before merging PR:
Associated PRs (Link as appropriate):