Skip to content

Fix "database is locked" error (occurring in the context of workflow testing under SQLite)#16208

Merged
mvdbeek merged 1 commit intogalaxyproject:devfrom
jdavcs:dev_workflow_scheduling_loop_fix
Jun 8, 2023
Merged

Fix "database is locked" error (occurring in the context of workflow testing under SQLite)#16208
mvdbeek merged 1 commit intogalaxyproject:devfrom
jdavcs:dev_workflow_scheduling_loop_fix

Conversation

@jdavcs
Copy link
Member

@jdavcs jdavcs commented Jun 7, 2023

Factored out from #15421.

This solves 🤞 the sqlite database locking error that occurred in the context of testing workflows.

This also solves the workflow transaction error that happened on every workflow scheduling attempt with autocommit=False. Rationale for the autocommit=False fix: this transaction is not needed: every flush that was called in the context of a workflow execution will be wrapped in a transaction that commits.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    Run this test: lib/galaxy_test/api/test_jobs.py::TestJobsApi::test_index_workflow_filter_implicit_jobs under sqlite (i.e., default connection) on the dev branch (will fail with the sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked error. Then switch to this branch and rerun. Observe no error.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

This solves the workflow transaction error that happened on every
workflow scheduling attempt with autocommit=False.

This transaction is not needed: every flush that was called in the
context of a workflow execution is now wrapped in a transaction that
commits.
@jdavcs jdavcs added kind/bug area/workflows area/database Galaxy's database or data access layer labels Jun 7, 2023
@jdavcs jdavcs added this to the 23.1 milestone Jun 7, 2023
@mvdbeek mvdbeek merged commit 0e142a8 into galaxyproject:dev Jun 8, 2023
@mvdbeek
Copy link
Member

mvdbeek commented Jun 8, 2023

Thank you @jdavcs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/database Galaxy's database or data access layer area/workflows kind/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants