dumbpipe icon indicating copy to clipboard operation
dumbpipe copied to clipboard

avoid dumbpipe connect displaying "error: connection lost"

Open joeyh opened this issue 1 month ago • 0 comments

echo foo | dumbpipe connect endpoint[REDACTED]
using secret key [REDACTED]
bar
error: connection lost

Dumbpipe is treating this as an error including exiting nonzero. But it has successfully relayed all stdin to the remote peer, and relayed back everything the peer replied with.

I think the reason this may be treated as an error is that the peer would accept additional input after the "foo". That's because I am using dumbpipe to connect to a peer that serves a line-based protocol, so would be willing to respond to additional commands. When it gets to EOF though, it does hang up.

The peer is running dumbpipe listen-unix --socket-path=. With the peer instead using dumbpipe listen, the dumbpipe connect doesn't error out like that. But in that case, it does wait for the peer to finish sending back everything on its stdin. Which is also not desirable when serving this kind of line-based protocol.

This affects git-annex when using git-annex-p2p-iroh, the "error: connection lost" message gets displayed here and there, although it does not cause any actual problems.

joeyh avatar Nov 03 '25 19:11 joeyh