llama-stack-mirror/llama_stack/providers
Omer Tuchfeld 49c34dd0d4 Use pool_pre_ping=True in SQLAlchemy engine creation
We noticed that when llama-stack is running for a long time,  we would
run into database errors when trying to run messages through the agent
(which we configured to persist against postgres), seemingly due to the
database connections being stale or disconnected. This commit adds
`pool_pre_ping=True` to the SQLAlchemy engine creation to help mitigate
this issue by checking the connection before using it, and
re-establishing it if necessary.

More information in:

https://docs.sqlalchemy.org/en/20/core/pooling.html#dealing-with-disconnects

We're also open to other suggestions on how to handle this issue, this
PR is just a suggestion, we have not tested it yet (we're in the process
of doing that) and we're hoping it's going to resolve our issue.
2025-08-20 13:33:00 +02:00
..
inline chore(pre-commit): add pre-commit hook to enforce llama_stack logger usage (#3061) 2025-08-20 07:15:35 -04:00
registry feat: add batches API with OpenAI compatibility (with inference replay) (#3162) 2025-08-15 15:34:15 -07:00
remote chore(pre-commit): add pre-commit hook to enforce llama_stack logger usage (#3061) 2025-08-20 07:15:35 -04:00
utils Use pool_pre_ping=True in SQLAlchemy engine creation 2025-08-20 13:33:00 +02:00
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
datatypes.py feat: create unregister shield API endpoint in Llama Stack (#2853) 2025-08-05 07:33:46 -07:00