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

mDNS records expire when connection times out #3309

Closed
felinira opened this issue Jan 6, 2023 · 2 comments · Fixed by #3367
Closed

mDNS records expire when connection times out #3309

felinira opened this issue Jan 6, 2023 · 2 comments · Fixed by #3367

Comments

@felinira
Copy link
Contributor

felinira commented Jan 6, 2023

Summary

mDNS records are expiring when an unrelated connection timeout with said peer is reached (eg. the gossipsub default of 120 seconds, or the floodsub default of… 10 seconds?). The problem is that connections may close for any unrelated reason. This does not render the peer unreachable. It is completely valid to reopen a connection to the peer again in many cases.

From the docs of mdns::Event:

Each discovered record has a time-to-live. When this TTL expires and the address hasn’t been refreshed, we remove it from the list and emit it as an Expired event.`

The current behavior differs from the documentation and will expire nodes for any connection related timeout that has nothing to do with mDNS.

The examples are suggesting that an expired node is not reachable anymore and remove them from eg. gossipsub/floodsub. But this is not true if the connection has stopped due to a timeout and the peer remains reachable / the TTL has not yet expired.

Expected behaviour

mDNS nodes only expire when their DNS TTL is reached and unrelated connection issues and timeouts will not expire mDNS nodes.

Actual behaviour

mDNS nodes expire when a related connection times out. This makes floodsub-based chats completely unusable and gossipchat-based chats will expire after 120 seconds.

Debug output of the connection timeout in example chat-tokio. I added a few println! statements to the mDNS events. The peer is expired 10 seconds after discovery.

Debug Output

[2023-01-06T01:20:13Z INFO  libp2p_mdns::behaviour] discovered: 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp /ip4/192.168.122.1/tcp/33273
[2023-01-06T01:20:13Z INFO  libp2p_mdns::behaviour] discovered: 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp /ip4/192.168.42.60/tcp/33273
Discovered peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp
Discovered peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp
[2023-01-06T01:20:13Z DEBUG libp2p_tcp] dialing 192.168.122.1:33273
[2023-01-06T01:20:13Z DEBUG libp2p_tcp] dialing 192.168.42.60:33273
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG libp2p_tcp] New listen address: /ip4/192.168.42.60/tcp/41537
[2023-01-06T01:20:13Z DEBUG libp2p_swarm] Listener ListenerId(3635681165069297728); New address: "/ip4/192.168.42.60/tcp/41537"
Listening on "/ip4/192.168.42.60/tcp/41537"
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /noise
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Received confirmation for protocol: /noise
[2023-01-06T01:20:13Z DEBUG libp2p_tcp] New listen address: /ip4/192.168.122.1/tcp/41537
[2023-01-06T01:20:13Z DEBUG libp2p_swarm] Listener ListenerId(3635681165069297728); New address: "/ip4/192.168.122.1/tcp/41537"
Listening on "/ip4/192.168.122.1/tcp/41537"
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG libp2p_tcp] Incoming connection from /ip4/192.168.42.60/tcp/59240 at /ip4/192.168.42.60/tcp/41537
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: confirming protocol: /noise
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: sent confirmed protocol: /noise
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /noise
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Received confirmation for protocol: /noise
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /mplex/6.7.0
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: confirming protocol: /mplex/6.7.0
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: sent confirmed protocol: /mplex/6.7.0
[2023-01-06T01:20:13Z DEBUG libp2p_mplex::io] New multiplexed connection: f36a73bdbc5b8d46
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG libp2p_swarm] Connection established: PeerId("12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp") Listener { local_addr: "/ip4/192.168.42.60/tcp/41537", send_back_addr: "/ip4/192.168.42.60/tcp/59240" }; Total (peer): 1. Total non-banned (peer): 1
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /mplex/6.7.0
[2023-01-06T01:20:13Z DEBUG libp2p_mplex::io] f36a73bdbc5b8d46: New outbound substream: (0/initiator) (total 1)
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /floodsub/1.0.0
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Received confirmation for protocol: /mplex/6.7.0
[2023-01-06T01:20:13Z DEBUG multistream_select::dialer_select] Dialer: Received confirmation for protocol: /floodsub/1.0.0
[2023-01-06T01:20:13Z DEBUG libp2p_mplex::io] f36a73bdbc5b8d46: Closed substream (0/initiator) (half-close)
[2023-01-06T01:20:13Z DEBUG libp2p_mplex::io] New multiplexed connection: 5b1d18a264ab973a
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG libp2p_mplex::io] 5b1d18a264ab973a: New inbound substream: (0/receiver) (total 1)
[2023-01-06T01:20:13Z DEBUG libp2p_swarm] Connection established: PeerId("12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp") Dialer { address: "/ip4/192.168.122.1/tcp/33273/p2p/12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp", role_override: Dialer }; Total (peer): 2. Total non-banned (peer): 2
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: confirming protocol: /floodsub/1.0.0
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG multistream_select::listener_select] Listener: sent confirmed protocol: /floodsub/1.0.0
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:13Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:13Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z DEBUG libp2p_swarm] Connection closed with error KeepAliveTimeout: Connected { endpoint: Listener { local_addr: "/ip4/192.168.42.60/tcp/41537", send_back_addr: "/ip4/192.168.42.60/tcp/59240" }, peer_id: PeerId("12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp") }; Total (peer): 1.
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z DEBUG libp2p_swarm] Connection closed with error KeepAliveTimeout: Connected { endpoint: Dialer { address: "/ip4/192.168.122.1/tcp/33273/p2p/12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp", role_override: Dialer }, peer_id: PeerId("12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp") }; Total (peer): 0.
[2023-01-06T01:20:23Z DEBUG libp2p_tcp] dialing 192.168.122.1:33273
[2023-01-06T01:20:23Z DEBUG libp2p_tcp] dialing 192.168.42.60:33273
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] reading incoming messages
[2023-01-06T01:20:23Z DEBUG netlink_proto::codecs] NetlinkCodec: decoding next message
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwarding unsolicited messages to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] forwaring responses to previous requests to the connection handle
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] handling requests
[2023-01-06T01:20:23Z DEBUG netlink_proto::connection] sending messages
[2023-01-06T01:20:23Z INFO  libp2p_mdns::behaviour] expired: 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp /ip4/192.168.122.1/tcp/33273
[2023-01-06T01:20:23Z INFO  libp2p_mdns::behaviour] expired: 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp /ip4/192.168.42.60/tcp/33273
Expired peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp
[2023-01-06T01:20:23Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /noise
Removing peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp from floodsub
[2023-01-06T01:20:23Z DEBUG multistream_select::dialer_select] Dialer: Proposed protocol: /noise
Expired peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp
Removing peer 12D3KooWQ9fYo4U7eckzGsftxA69bC2iQUg5jjSwxVvQNCgiqMKp from floodsub

Possible Solution

Version

  • libp2p version (version number, commit, or branch): master

Would you like to work on fixing this bug?

Maybe

@mxinden
Copy link
Member

mxinden commented Jan 17, 2023

Thanks for the detailed report.

I think your point is valid, i.e. connection closing does not correlate with availability of a remote's address.

A patch would be very welcome.

@felinira
Copy link
Contributor Author

A patch would be very welcome.

I'll see what I can do

felinira added a commit to felinira/rust-libp2p that referenced this issue Jan 23, 2023
felinira added a commit to felinira/rust-libp2p that referenced this issue Jan 23, 2023
felinira added a commit to felinira/rust-libp2p that referenced this issue Jan 23, 2023
@mergify mergify bot closed this as completed in #3367 Jan 27, 2023
mergify bot pushed a commit that referenced this issue Jan 27, 2023
mDNS records should not be expiring when an unrelated connection timeout with said peer is reached.

Fixes #3309.
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 a pull request may close this issue.

2 participants