apple / swift-distributed-actors

Peer-to-peer cluster implementation for Swift Distributed Actors
https://apple.github.io/swift-distributed-actors/
Apache License 2.0
580 stars 54 forks source link

Lowest address ordering fix #1142

Closed akbashev closed 8 months ago

akbashev commented 8 months ago

Motivation:

Currently there is a bug in lowest address ordering where it will sort nodes and choose lowest not by address, but by alphabetical order (or guess unicode order) of systemName node's variables.

Modifications:

Changed implementation of Comparable for ClusterEndpoint and tweaked tests a bit.

Result:

akbashev commented 8 months ago

Event though it's working now properly, I've implemented it naively by string check "(protocol)(host)(port)" and not quite sure about that. 🤔 Maybe there is a better comparison logic? What does mean to check by lowest name of protocol? 🤔

ktoso commented 8 months ago

A system will never really have different protocols, so this is okey I think

ktoso commented 8 months ago

@swift-server-bot test this please