status-go icon indicating copy to clipboard operation
status-go copied to clipboard

Race issue between batch.acknowledged event and envelope.sent event

Open dshulyak opened this issue 6 years ago • 1 comments

Problem

We are sending envelope.sent event right after envelopes were successfully written to socket corresponding to the peer. Batch.acknowledged event is sent when peer reads those envelopes and responds with a confirmation for them. In case if there is no delay before responding back with confirmation (e.g. without actual network), it may happen that batch.acknowledged event will be sent sooner that envelope.sent event.

This situation may cause issue, because there is no synchronization between those two places. But i can only reproduce it without network (using in memory connection mock).

Implementation

Ideally we will need to order those events somehow, but without introducing synchronization in those parts

dshulyak avatar Feb 21 '19 08:02 dshulyak

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

status-github-bot[bot] avatar Aug 05 '21 16:08 status-github-bot[bot]