Files
galaxy/lib
mvdbeek 54c93a609b Fix tag creation self-deadlock under SQLite
`TagHandler._create_tag_instance` created the `Tag` in a *separate* session
and committed it, to keep a unique-name `IntegrityError` from aborting the
caller's transaction. When this runs inside an open write transaction - e.g.
applying a tag to an output during workflow job creation - that second
connection's commit deadlocks against the first on SQLite's single-writer
lock, surfacing intermittently as "(sqlite3.OperationalError) database is
locked" and failing the job (and the workflow invocation). It is timing
sensitive, so any small latency in the surrounding code makes it reproducible.

Insert the tag on the session's own connection with
`INSERT ... ON CONFLICT (name) DO NOTHING` (SQLite and PostgreSQL both support
it natively), preserving the duplicate-name isolation without a second
connection. Other backends keep the separate-session fallback - the
single-writer deadlock is SQLite-specific.
2026-06-07 11:47:52 +02:00
..