You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concurrent WebSocket connections for the same project can both create and start a ProjectContext before either one stores it in _projects. When both contexts initialize the same SQLite spec index at the same time, one can fail with sqlite3.OperationalError: database is locked.
Steps to reproduce
Start two WebSocket clients for the same fresh project at nearly the same time.
Have both clients call RPC methods, such as spec/list.
This showed up in CI in tests/rpc/test_server.py::TestMultiClientIntegration::test_two_clients_both_can_call_rpc.
Expected behavior
Only one ProjectContext.start() should run per project, and concurrent clients should share the same initialized context.
Actual behavior
The second concurrent startup can try to initialize the same SQLite index and fail:
Description
Concurrent WebSocket connections for the same project can both create and start a
ProjectContextbefore either one stores it in_projects. When both contexts initialize the same SQLite spec index at the same time, one can fail withsqlite3.OperationalError: database is locked.Steps to reproduce
spec/list.tests/rpc/test_server.py::TestMultiClientIntegration::test_two_clients_both_can_call_rpc.Expected behavior
Only one
ProjectContext.start()should run per project, and concurrent clients should share the same initialized context.Actual behavior
The second concurrent startup can try to initialize the same SQLite index and fail:
Environment
python --version): Python 3.11.15 in the failing CI runnode --version): N/A71096ac200c1f240a6e63127a179bca9ecd352d4