Closed mkoura closed 1 week ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.
Explanation for the confusing json output (trailing ] }
): https://github.com/input-output-hk/cardano-cli/issues/197#issuecomment-1723419123
Since this issue was opened, the output was jsonified: https://github.com/input-output-hk/cardano-cli/pull/411, albeit the crux of this issue is still there.
Can reproduce as of 04b1ccf1fc79864b52052138ae1e127ddf853fe9:
→ cabal run cardano-cli -- ping -u $HOME/dev/sanchonet/node.socket --magic 4 -j
/home/churlin/dev/sanchonet/node.socket {"network_rtt":1.1953e-5}
/home/churlin/dev/sanchonet/node.socket {"handshake_rtt":1.48992e-4}
/home/churlin/dev/sanchonet/node.socket {"negotiated_version":{"magic":4,"version":"NodeToClientVersionV16"}}
] }
That's because this conditional in ourboros-network is not entered in the case where isUnixSocket
holds.
If I remove the isUnixSocket
condition, then cardano-cli ping
fails as follows:
> cabal run cardano-cli -- ping -u $HOME/dev/sanchonet/node.socket --magic 4 -c 5 -j
/home/churlin/dev/sanchonet/node.socket {"network_rtt":1.3868e-5}
/home/churlin/dev/sanchonet/node.socket {"handshake_rtt":3.25788e-4}
pintOptsHandshakeQuery: False
querySupported: True
isUnixSocket: True
/home/churlin/dev/sanchonet/node.socket {"negotiated_version":{"magic":4,"version":"NodeToClientVersionV16"}}
] }
(AddrInfo {addrFlags = [], addrFamily = AF_UNIX, addrSocketType = Stream,
addrProtocol = 0, addrAddress = /home/churlin/dev/sanchonet/node.socket, addrCanonName = Nothing},
MuxError MuxBearerClosed "<socket: 11> closed when reading data, waiting on next header True")
But at this point, I need to spend more time digging whether the ping
protocol can be supported in the case of Unix sockets. This is probably normal that this doesn't work, in which case the user-facing UI of cardano-cli ping
needs to be amended, to avoid looking like it supports it, whereas it doesn't.
I'll ask @coot to fill me in and update here accordingly. Expect some delay.
@mkoura the node-to-client
protocol doesn't include keep-alive
mini-protocol, only node-to-node
does, so there's no way to send pings
on a unix socket. The command is still useful for node-to-client
, as it allows to debug connectivity / version mismatch issues. One possible solution would be to simply expose a cardano-cli handshake
command which negotiate the connection and limit ping
to node-to-node
.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.
This issue was closed because it has been stalled for 120 days with no activity. Remove stale label or comment or this will be closed in 60 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.
Description
The
cardano-cli ping --unixsock
is not sending pings. The behavior doesn't seem to correspond with the command name as is potentially confusing for end user.Also notice the confusing json output.
Tested with cardano-cli 8.2.1 on Linux.
[edit] after discussions with @mkoura and @coot. We will:
handshake
command that works for both node-to-client and node-to-node.--unixsock
option fromping
[edit] after review by @Jimbo4350 here, we finally decided to:
--handshake-only
flag toping
-u/--unixsock
work only with--handshake-only
(i.e.--unixsock
is conditioned by presence of--handshake-only
is specified)-Q/--query-versions
inping
.-Q
should preferably be used with--handshake-only
.