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

postgresql

(raevan) #1

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.


(Rebecca Taft) #2

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: https://www.cockroachlabs.com/docs/stable/transactions.html#transaction-retries.

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

– Becca


(raevan) #3

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.

Raevan
Movatic Co


(Rebecca Taft) #4

Glad to hear it! Thanks for following up.


(raevan) #5

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

Raevan


(Rebecca Taft) #6

Hi @raevan,

Sorry you are still running into problems with CockroachDB and SQLAlchemy. Your colleague opened an issue about this: https://github.com/cockroachdb/cockroachdb-python/issues/52. 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