cockroachdb / cockroachdb/sqlalchemy-cockroachdb

sqlalchemy.exc.ResourceClosedError: This Connection is closed

Open
#97 9 comments 0 reactions 1 assignee Claimed by @rafiss View on GitHub
bug
Dominant language
Python
Stars
156
Forks
65
PR merge metrics
No merged PRs in 30d

Description

We are using from cockroachdb.sqlalchemy import run_transaction in a multi-threaded python application.

Occasionally we are receiving the following error that sqlalchemy.exc.ResourceClosedError: This Connection is closed

Based on my research I'm not sure if this is related to the application being multi-threaded or the need for connection disconnect error handling.

Would someone be able to confirm that run_transaction is, in fact, thread-safe?

If it is thread-safe is there a suggested strategy for implementing connection disconnect?
https://docs.sqlalchemy.org/en/13/core/pooling.html#pool-disconnects

Also, would this solution be something that should be added into run_transaction?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.