Set Cassandra connect timeout, not just regular timeout #12903
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It looks like Cassandra sessions have both a "connect timeout" that governs timeouts when initiating connections, and a regular timeout used post-initialization. Our connection producer also has a "connect timeout", but only uses it for setting the latter. I think we should use it for both timeouts.
I think this will help our recurring test failures: from what I can see in the Cassandra code, if you don't set a connect timeout explicitly, it will use 600ms as the default, even if you have a regular timeout configured. Consider this set of test runs from https://app.circleci.com/pipelines/github/hashicorp/vault/22034/workflows/f814993d-7326-4ab5-8ced-a088ab2087f2/jobs/313877/parallel-runs/2
These tests aren't using t.Parallel, so I believe this is all happening in sequence, all against the same Cassandra docker instance. We have failures bracketed by successes, suggesting that the container came up fine, we just weren't always able to connect to it within 600ms.