n0-computer / n0-computer/dumbpipe
avoid dumbpipe connect displaying "error: connection lost"
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 782
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with dumbpipe connect against listen-unix, then compare it with dumbpipe listen using the line-based protocol described in the issue. Trace how connect handles stdin EOF and a peer hangup; done means successfully relaying the exchange without printing "error: connection lost" or exiting nonzero when no data was lost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100