-
Notifications
You must be signed in to change notification settings - Fork 212
Closed
Labels
Description
By default, SQLAlchemy sessions work in autoflush=True mode. In this mode, all pending changes to the session are committed on any session.execute, so even selects may trigger write operations. It can be a big problem on SQLite leading to long write transactions and "database is locked" errors.
Switch to autoflush=False. This is a huge change to ORM semantics but luckily for us, the dstack code does not rely on autoflush much. There are few places that need to be fixed:
Potentially:
generate_*_namefunctions like this but only if used to create multiple objects in a session.
On a related note, ensure there are no long write transactions.
Reactions are currently unavailable