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

Bug Report: Stuck Goroutine in libp2p-pubsub handleSendingMessages #544

Open
frystal opened this issue Sep 27, 2023 · 3 comments
Open

Bug Report: Stuck Goroutine in libp2p-pubsub handleSendingMessages #544

frystal opened this issue Sep 27, 2023 · 3 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@frystal
Copy link

frystal commented Sep 27, 2023

Description:

A critical issue has been identified in the libp2p-pubsub library. Specifically, in the process of a peer publishing a new RPC message to other peers through the function "handleSendingMessages", the function attempts to send messages on an existing stream towards remote peers.

image

However, if the libp2p-pubsub is configured to use the default "Yamux" as the muxer, the "Write" function operates synchronously without a time limitation. In the event that the write operation in "go-yamux" becomes stuck, it leads to the entire goroutine of "handleSendingMessages" becoming stuck. Consequently, any remaining messages destined for the target remote peer will be dropped due to the queue becoming full.

image

Expected Outcome:

The libp2p-pubsub library should handle situations where the Write operation becomes stuck in "go-yamux" without causing the entire goroutine of "handleSendingMessages" to become stuck.

Actual Outcome:

The current implementation results in the entire goroutine of "handleSendingMessages" getting stuck, leading to dropped messages due to a full queue.

Environment:

go-libp2p-pubsub@v0.9.3

@vyzo
Copy link
Collaborator

vyzo commented Sep 28, 2023

Sure, but if the sender is stuck you won't be able to send messages anyway.

What do you propose to do?

@frystal
Copy link
Author

frystal commented Sep 28, 2023

Could you please assign it the 'bug' label?

@vyzo vyzo added the kind/bug A bug in existing code (including security flaws) label Sep 28, 2023
@vyzo
Copy link
Collaborator

vyzo commented Sep 28, 2023

Done, but I am not sure we can resolve this. I will welcome a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants