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

Avoid session idle timeouts #77

Open
andrefurlan-db opened this issue Dec 13, 2022 · 5 comments
Open

Avoid session idle timeouts #77

andrefurlan-db opened this issue Dec 13, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@andrefurlan-db
Copy link
Contributor

Sessions time out. And a connection is associated with a session. If the user does not set max connection idle timeout, it is possible that they'll get errors on session timeout.

We need to either have a heartbeat, or figure out a way to invalidate the session and create a new one. Or as a last resort gracefully handle the error.

@andrefurlan-db andrefurlan-db added the bug Something isn't working label Dec 13, 2022
@farhank3389
Copy link

farhank3389 commented May 19, 2023

Any updates on this one please?

@andrefurlan-db
Copy link
Contributor Author

Sorry for the delay. There were many discussions on how to deal with this and heartbeats have many drawbacks. SQL Warehouses now have a 8 hour session idle timeout, so this should not be a real issue. Is the concern now primarily related to clusters?

@cghiban
Copy link

cghiban commented Jun 1, 2023

In my case, I have a web app that works with DataBricks and was wondering what would be the best way to handle session timeouts without restarting the server

databricks: execution error: failed to execute query: Invalid SessionHandle

@farhank3389
Copy link

No worries, thanks for the reply.

My issue is similar to @cghiban, I have an app that uses the warehouse so I have to restart it every now and again in order to refresh the session.

@andrefurlan-db
Copy link
Contributor Author

oh, in your case, please set https://pkg.go.dev/database/sql#DB.SetConnMaxIdleTime

This will prevent the issue you're having. No need to restart the pod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants