The goal of this PR is to resolve 3 small bugs, all related to opening connections, especially sharded ones.
289
This possible leak of goroutines was caused by OpenConn not closing the goroutines started by it immediately, returning a working connection with an error instead of closing it, leaving it to the caller. Now it's handled properly by closing it there.
I added a test checking if the behavior is correct when the handshake fails using a TCP server returning responses that would trigger that fail.
Now context.Err() is checked before each OpenShardConn call, ensuring we don't try opening connections after context is done,
The last 2 commits together reduce the integration test logs from ~40k lines to ~800 lines, this is a proof that context done actually cancels operations right away.
The goal of this PR is to resolve 3 small bugs, all related to opening connections, especially sharded ones.
289
This possible leak of goroutines was caused by OpenConn not closing the goroutines started by it immediately, returning a working connection with an error instead of closing it, leaving it to the caller. Now it's handled properly by closing it there. I added a test checking if the behavior is correct when the handshake fails using a TCP server returning responses that would trigger that fail.
281
Now retries in OpenShardConn happen only when the error is either EADDRINUSE or EPERM as mentioned in https://github.com/scylladb/scylla-go-driver/pull/286#pullrequestreview-1114185328
291
Now context.Err() is checked before each OpenShardConn call, ensuring we don't try opening connections after context is done,
The last 2 commits together reduce the integration test logs from ~40k lines to ~800 lines, this is a proof that context done actually cancels operations right away.
Fixes: #289 Fixes: #281 Fixes: #291