scylladb / scylla-go-driver

Experimental, high performance Scylla Driver, University of Warsaw students' project
Apache License 2.0
151 stars 7 forks source link

transport: fixed an overflow in ShardPortIterator #282

Closed Kulezi closed 2 years ago

Kulezi commented 2 years ago

There was an overflow in ShardPortIterator, leading the driver sometimes to dial from source ports outside of range specified in routing.go by minPort and maxPort, trying dialing from reserved ports. Also this overflow can make the driver pick a source port that doesn't correspond to the queried shard.

This PR removes this overflow, and adds a test checking for correct behavior of ShardPortIterator.