-
Notifications
You must be signed in to change notification settings - Fork 100
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
dcr: Remove tx history wait. #3005
Conversation
Example showing this behavior https://go.dev/play/p/F6KWiFSUfZb |
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.
Nice.
client/asset/dcr/dcr.go
Outdated
var wg sync.WaitGroup | ||
wg.Add(1) | ||
go func() { | ||
defer wg.Done() | ||
dcr.syncTxHistory(ctx, uint64(newTipHeight)) | ||
}() | ||
go dcr.syncTxHistory(ctx, uint64(newTipHeight)) |
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.
How about using the ExchangeWallet.wg
here instead so at least we don't have an unmonitored goroutine?
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.
cf6665c
to
ec312e6
Compare
SyncStatus has a chance to hold the tipMtx so run it in a goroutine and do not wait.
ec312e6
to
9cc5f72
Compare
SyncStatus has a chance to hold the tipMtx so run it in a goroutine and do not wait.
closes #2971
handleTipChange
must wait until the go functions are finished, so the tipMtx is held for writes for both of them. syncTxHistory calls SyncStatus which also conditionally holds the tipMtx for reads, randomly causing deadlock. I think running syncTxHistory as a goroutine and not waiting is the simplest answer.