Issue: acceptance: failure in sqlalchemy test due to retry error

Using flask with sqlAlchemy and cockroach db we randomly get this error it seems when doing POST or PUTS into the database.

Any suggestions or help is appreciated.

Hi @raevan,

The issue you referenced is about a test failure. Retryable errors are a normal occurrence in CockroachDB, and must be handled in your code. Please see the documentation here for more information:

Hope this helps! Please don’t hesitate to ask if you have other questions.

– Becca

Good morning Rebbeca,

Thanks for the quick response, its really appreciated since this issue has been a big deal for our user experience.

Thank you for giving us some direction toward what the cause of the issue was, with some more research and teetering around we were able to resolve it and its a huge relief.

Movatic Co

Glad to hear it! Thanks for following up.

Hi Rebbeca,
We implemented the run_transaction used with session maker, and we are now getting an a que pool overflow limit error, it seems like the sessions aren’t being cleaned up correctly


Hi @raevan,

Sorry you are still running into problems with CockroachDB and SQLAlchemy. Your colleague opened an issue about this: As I mentioned in my last comment there, run_transaction is the recommended way to handle transaction retries in SQL Alchemy. There is likely some other issue causing the performance degradation.

Please add any additional information as a comment on that issue so we can keep all relevant information in one place.

Thank you for your patience!

– Becca