fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine #10968

Closed
HAL9000 wants to merge 1 commit from bugfix/m3-migration-runner-check-same-thread into master
Owner

Summary

  • Adds connect_args={"check_same_thread": False} to the SQLite engine created in get_current_revision(), consistent with init_or_upgrade() which already applies this setting for all SQLite engines.
  • Adds a Behave scenario in consolidated_misc.feature to verify the fix.
  • Adds the corresponding step definition in migration_runner_steps.py.

Problem

MigrationRunner.get_current_revision() was creating a SQLite engine without connect_args={"check_same_thread": False}. This caused a ProgrammingError: SQLite objects created in a thread can only be used in that same thread when get_current_revision() was called from a different thread than the one that created the engine.

This was inconsistent with init_or_upgrade(), which correctly passes check_same_thread=False for all SQLite engines.

Closes #10952

This PR blocks issue #10952


Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker

## Summary - Adds `connect_args={"check_same_thread": False}` to the SQLite engine created in `get_current_revision()`, consistent with `init_or_upgrade()` which already applies this setting for all SQLite engines. - Adds a Behave scenario in `consolidated_misc.feature` to verify the fix. - Adds the corresponding step definition in `migration_runner_steps.py`. ## Problem `MigrationRunner.get_current_revision()` was creating a SQLite engine without `connect_args={"check_same_thread": False}`. This caused a `ProgrammingError: SQLite objects created in a thread can only be used in that same thread` when `get_current_revision()` was called from a different thread than the one that created the engine. This was inconsistent with `init_or_upgrade()`, which correctly passes `check_same_thread=False` for all SQLite engines. Closes #10952 This PR blocks issue #10952 --- Automated by CleverAgents Bot Supervisor: Implementation | Agent: implementation-worker
HAL9000 added this to the v3.2.0 milestone 2026-05-05 03:34:06 +00:00
fix(database/migration_runner): add check_same_thread=False to get_current_revision() SQLite engine
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 55s
CI / security (pull_request) Failing after 1m33s
CI / benchmark-regression (pull_request) Failing after 33s
CI / helm (pull_request) Failing after 15m1s
CI / build (pull_request) Failing after 15m3s
CI / e2e_tests (pull_request) Failing after 15m3s
CI / integration_tests (pull_request) Failing after 15m6s
CI / unit_tests (pull_request) Failing after 15m8s
CI / quality (pull_request) Failing after 15m9s
CI / typecheck (pull_request) Failing after 15m9s
CI / lint (pull_request) Failing after 15m9s
CI / coverage (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
CI / status-check (pull_request) Has been cancelled
b9e37bbf9c
Pass connect_args={"check_same_thread": False} when creating a SQLite engine
in get_current_revision(), consistent with init_or_upgrade() which already
applies this setting for all SQLite engines. Without this fix, calling
get_current_revision() from a different thread than the one that created
the engine raises a ProgrammingError.

ISSUES CLOSED: #10952
HAL9000 closed this pull request 2026-05-05 05:15:21 +00:00
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 55s
CI / security (pull_request) Failing after 1m33s
Required
Details
CI / benchmark-regression (pull_request) Failing after 33s
CI / helm (pull_request) Failing after 15m1s
CI / build (pull_request) Failing after 15m3s
Required
Details
CI / e2e_tests (pull_request) Failing after 15m3s
CI / integration_tests (pull_request) Failing after 15m6s
Required
Details
CI / unit_tests (pull_request) Failing after 15m8s
Required
Details
CI / quality (pull_request) Failing after 15m9s
Required
Details
CI / typecheck (pull_request) Failing after 15m9s
Required
Details
CI / lint (pull_request) Failing after 15m9s
Required
Details
CI / coverage (pull_request) Has been cancelled
Required
Details
CI / docker (pull_request) Has been cancelled
Required
Details
CI / status-check (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core!10968
No description provided.