Skip to content

Cluster client rejects ports > 55535 #22

Description

@fishy

Currently there's a logic in cluster client that if the redis port > 55535 it will just fail:

if !ok || !ok2 || port <= 0 || port+10000 > 65535 {

I don't see any comment explaining why. This is currently causing us problems when we use miniredis in unit tests. Miniredis by default just bind to 127.0.0.1:0 and let the OS assign an available port to it, and if the OS assigns a port that's in the range of (55535, 65535], the cluster client will just refuse to connect to it and fail the unit test.

This seems to be more frequent on mac than linux (maybe mac tend to assign higher ports in this case?), which makes the unit tests more flaky on macs in our case.

Is there a good reason for this restriction? If not, can we remove it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions