Skip to content

Conversation

@peterbroadhurst
Copy link
Contributor

This is to avoid the A->B, B->A deadlock due to differently ordered database operations with the new table lock, seen under a high concurrency performance test in #493 (comment)

…tion

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>

func (bp *batchProcessor) markMessagesDispatched(batch *fftypes.Batch) error {
return bp.retry.Do(bp.ctx, "batch persist", func(attempt int) (retry bool, err error) {
return bp.retry.Do(bp.ctx, "mark dispatched messages", func(attempt int) (retry bool, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

// We choose (today) to coordinate the emission of these, into a DB transaction where the other
// state changes happen - so the event is assured atomically to happen "after" the other state
// changes, but also not to be lost. Downstream fan-out of those events occurs via
// Wehook/WebSocket (.../NATS/Kafka) pluggable pub/sub interfaces.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wehook sounds like a web3 fishing conglomerate

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🎣

Copy link
Contributor

Choose a reason for hiding this comment

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

HooksDAO

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

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

Simple enough - LGTM

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst peterbroadhurst merged commit 9a38438 into hyperledger:main Feb 11, 2022
@peterbroadhurst peterbroadhurst deleted the fix-event-deadlock branch February 11, 2022 21:32
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