haskell-distributed / haskell-distributed/distributed-process
Connection failure with localhost
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 751
- Forks
- 99
- Avg merge
- 45m
- Merged PRs (30d)
- 2
Description
I'm observing failures when trying to connect and send messages to localhost:
TransportError ConnectFailed "Network.Socket.recvBuf: resource vanished (Connection reset by peer)"
I did not construct a minimal example, but I've traced the issue to the following commit to network-transport-tcp. In particular the original failure occurs in this line. The issue is that at this point sockAddr has the value ::1 but decodeSockAddr only supports IPv4 addresses. Adding a dummy case that handles IPv6 and always returns 127.0.0.1:<port> fixes the connection failures in my case.
The IPv6 address originates from this call to N.getAddrInfo when host="localhost".
A work-around is to always use 127.0.0.1 instead of localhost.
This depends on system configuration, as the issue was only observed on some machines.
Contributor guide
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
Inspect commit 21cd334ef3aa78e2039eff3874fc2d63ea3cd6af, starting at the N.getAddrInfo call and decodeSockAddr around the linked failure line. Reproduce a connection using localhost on a system that resolves it to ::1, then verify that localhost connections no longer fail while IPv4 behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- distributed-systems, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100