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(p2p): prevent deadlock on simultaneous sending large message #4948

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

Erigara
Copy link
Contributor

@Erigara Erigara commented Aug 7, 2024

Description

When 2 peers try to send each other huge messages they end up deadlocked.
I suspect that this happen when message is large enough that it's not possible to fully put it in the OS buffer.

Here is minimal example i was able to came up with which suffers from the same issue.

Solution was to lift sending data up to the select! statement so peer can either read or write data simultaneously.

Benefits

No deadlock.

@Erigara Erigara merged commit 0089242 into hyperledger-iroha:main Aug 7, 2024
30 of 34 checks passed
mversic pushed a commit that referenced this pull request Aug 30, 2024
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