Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible for NewSession not to block #234

Open
dkropachev opened this issue Aug 16, 2024 · 1 comment
Open

Make it possible for NewSession not to block #234

dkropachev opened this issue Aug 16, 2024 · 1 comment
Assignees

Comments

@dkropachev
Copy link
Collaborator

dkropachev commented Aug 16, 2024

Idea is the following:

  1. You create cluster configuration
  2. You create session of it that does not actually connects to the cluster, but rather just starting this proccess.
  3. If you are trying to execute query on such session, if it is not ready yeat it will throw you an NotReady error
  4. Have an API that allows you to know if session is ready to execute queries

This API will make easier to develop apps for k8s, creating session on pod initialization and report connection status via liveness and readiness probs

@knadh
Copy link

knadh commented Aug 16, 2024

This is great. Separating initialization and actual connections solves a number of production edge cases. Couple of considerations:

  1. CreateSession() won't block and fail and will try to establish a connection in the background?
  2. CreateSession() won't connect initially, but only when it's used. For example, when doing a .Query()?

Either should be fine, but 2 gives fine grained control on the behaviour, where it's possible to have config to try and connect in the background immediately or to "lazy" connect only when the session is used for querying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants