-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from piodul/check-connection-on-session-create
session: fail creating session when control connection cannot be established In #440, a mechanism was added which, when a session is created and metadata fails to be fetched, uses dummy metadata in place of a real one. It was supposed to protect from situations where a faulty metadata parsing logic causes the whole session to fail; it's better to continue with incorrect metadata than lose availability. However, metadata fetch was also used as an implicit check of whether the driver can connect to the cluster at all, as metadata fetch requires a live control connection. Unfortunately, the fallback added in #440 does not distinguish this case. When a user provides wrong contact points/tls configuration/password/etc., the session will be created successfully but users will only learn that it doesn't work after trying to send requests. This PR improves the fallback logic. Now, session will fail to be created if control connection fails to be established, but it will continue with dummy metadata if the first fetch fails. Moreover, the error returned when the session is created contains information about why establishing the control connection failed. Fixes: #443
- Loading branch information
Showing
4 changed files
with
92 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters