apple / apple/swift-distributed-actors

Improve handshake reject on node address mismatch

Open
#388 1 comment 0 reactions 0 assignees View on GitHub
size/S t:cluster:all
Dominant language
Swift
Stars
679
Forks
84
PR merge metrics
No merged PRs in 30d

Description

When we do:

`swift run --package-path Samples SampleCluster 7337`

`swift run --package-path Samples SampleCluster 8228 127.0.0.1 7337`

`2020-01-22T18:34:51+0900 warning: [sact://System@localhost:7337][ClusterShell.swift:694][thread:383186][/system/cluster] Rejecting handshake from sact://System@localhost:8228, error: [targetHandshakeAddressMismatch(DistributedActors.Wire.HandshakeOffer(version: Version(0.0.1, reserved:0), from: sact://System:3738979271@localhost:8228, to: sact://System@127.0.0.1:7337), selfNode: sact://System:69133567@localhost:7337)]:HandshakeError`
`2020-01-22T18:34:51+0900 debug: [sact://System@localhost:7337][TransportPipelines.swift:139][thread:383174] Rejecting handshake offer from: [sact://System@localhost:8228] reason: [targetHandshakeAddressMismatch(DistributedActors.Wire.HandshakeOffer(version: Version(0.0.1, reserved:0), from: sact://System:3738979271@localhost:8228, to: sact://System@127.0.0.1:7337), selfNode: sact://System:69133567@localhost:7337)]`

which is "correct" I guess, we bound to localhost, but someone pinging us at 127.0.0.1.

Options:

- as this may be a popular mistake, provide a more explicit error about the mixing up of the hostname and ip style?
- make it smart such that understands localhost as 127.0.0.1? (likely bad idea, localhost could be _anything_ its just an entry in hosts after all.

Opinions @drexin @yim-lee ?

Contributor guide

Open the contributing guide

Research direction

Start by tracing the handshake rejection through ClusterShell.swift:694 and TransportPipelines.swift:139, reproducing it with the two SampleCluster commands in the report. First resolve whether the intended result is a clearer hostname/IP error or address normalization; done should make the selected behavior explicit and cover the mismatch case.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.