cockroachdb / cockroachdb/cockroach
Custom listening IP for `cockroach demo` without `--insecure`
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
Our test suite uses cockroachdb demo in multiple threads. It is hard to make the ports not collide with each other because we don't want to share state between threads. If we randomize the ports, there are still occasionally collisions and race conditions. Right now we use `--insecure` because it randomizes the IP within the loopback range `127.0.0.1/8` which effectively avoids collisions.
**Describe the solution you'd like**
A new option to specify listening IP (even if limited to loopback `127.0.0.1/8`) or a randomized loopback IP.
Ideally, we'd like IPv6 support too.
**Describe alternatives you've considered**
Techniques we've tried so far for randomizing the listening port are subject to race conditions, mainly because `cockroach demo` chooses a contiguous range of ports to listen on, one for each node. There's no good atomic way to check if all the ports are available. We'd prefer to randomize across a large range of loopback IPs to eliminate any practical chance of a collision.
Jira issue: CRDB-33275
Contributor guide
Assessment
This issue has not been assessed yet.