-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Is there any way to tell what PeerId has sent Inbound message in InboundUpgrade? #2602
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
Comments
The only way I see is logging the |
Yes, exactly. It's very hard to correlate. |
If it's not possible to provide That would allow me to understand who is on the other end of the socket. If that makes sense, I can try to implement that. |
Note that we are using the same |
Well, in Imagine a situation, where you're trying to communicate with some peer, and communication fails at Let me try to give more specific arguments. InboundUpgradeIn my case, some peers close connection before fully writing protocol message. That's And that's exactly what happened in my case. And I think I have a fix for that (as described here libp2p/rust-yamux#117). BUT since the network is rather inert when it comes to updates, some peers still follow invalid algorithm for sending data (ie closing too early). So my logs are still full of EOF errors, and it makes me uneasy, because I can't be sure I have fixed the problem. If I could tell multiaddress/peerid/etc of the sender, I could go to that peer and ask for it's version via other protocol (eg identify), or at least tell if it's one of peers managed by me or not. OutboundUpgradeThis would be a hypothetical example. Consider the following situation: I send protocol message to some peer, but sending fails. It throws an EOF error for some peers, and messages do not get delivered. If PeerId/multiaddress would be possible to learn, then I could pinpoint the peer at failure, and try to debug it somehow. Know its version, maybe talk to hoster of that peer, etc. Conclusion :)I see address information as vital for debugging networking problems. It is also feels natural to me to be able to access addresses of sockets, since OS has that information if I'm not mistaken. WDYT? Thanks for your openness and readiness to discuss possible changes in such a core API, really appreciate that. Cheers! |
I am still a bit reserved to add an additional argument to Would it not be an option to return an error from I might be missing something. |
Thank you, that sounds like what I originally wanted to know! |
Some Context
I'm debugging a heisenbug which happens periodically: peer A sends message to peer B, but peer B is unable to read it due to
unexpected end of file
error.And I'm having trouble reproducing and/or figuring out, which peer causes this. It would help me a lot if I could tell who has sent the message, i.e. PeerId of the sender.
I don't see how to get that info inside
upgrade_inbound
:Socket is
multistream_select::negotiated::Negotiated<rw_stream_sink::RwStreamSink<Chan>>
The Question
Is there a way to tell sender PeerId inside
InboundUpgrade
implementation like this one upgrade.rs#L115?Version
libp2p-core: 0.32
libp2p: 0.43
P.S.
Error happens inside
read_length_prefixed
. Exception looks like thisProtocol implementation is here https://github.com/fluencelabs/fluence/blob/master/particle-protocol/src/libp2p_protocol/upgrade.rs#L126
The text was updated successfully, but these errors were encountered: