Invalid SessionHandle: SessionHandle [...]

Open
#204 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, sqlalchemy
Domain
backend, databases

Research direction

Start by tracing the SQLAlchemy dialect's handling of the Invalid SessionHandle error and compare the behavior described in #160. Read the linked SQLAlchemy disconnect-handling and pre-ping documentation to identify the relevant integration point. Done means the connector recognizes this error as a disconnect and preserves connection recovery for occurrences that are not timeouts.

Written by the indexing model from the issue text.

Description

This is not the same as #160 as the error message is slightly different and the fix for that does not work. This happens well before an hour or any timeout could be reached (I've seen it within minutes of starting our backend locally before). It looks like there are other situations where this can happen besides a timeout.

My understanding is that the sqlalchemy dialect should let sqlalchemy know to invalidate the connection rather than just failing/erroring (e.g. see here), though I don't know enough to understand the correct way to do that. Based on the sqlalchemy documentation,it sounds like the pre-ping is dialect-specific. Not sure if that needs to be changed or something else. The sqlalchemy documentation has an example for handling specific errors as disconnects, but it's only for sqlalchemy 2.0, so that's not really useful here.

Dominant language
Python
Stars
233
Forks
152
Avg merge
21h 5m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databricks/databricks-sql-python

All issues in databricks/databricks-sql-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.