redispipe icon indicating copy to clipboard operation
redispipe copied to clipboard

Cluster client rejects ports > 55535

Open fishy opened this issue 3 years ago • 0 comments

Currently there's a logic in cluster client that if the redis port > 55535 it will just fail: https://github.com/joomcode/redispipe/blob/03ac18cd33dcc9a20fb90d2007902733dc019269/rediscluster/redisclusterutil/cluster.go#L80

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?

fishy avatar Jun 03 '22 15:06 fishy