mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-08 11:16:47 +00:00
refresh_instance_database opened the transaction first and then asked libvirt for the domain list. A host that goes silent on an established connection keeps that call waiting until keepalive gives up (30 s). On SQLite, the default database, the open transaction holds a read lock, so every other write of the app failed meanwhile with "database is locked", logins (session writes) included. Reproduced in the test setup: with a relay to a TCP compute frozen after connecting, three session writes during the 30 s refresh each failed after 5 s. - The connection check and listAllDomains run before the transaction, still under the compute lock, so create, delete and migration of the compute stay excluded as before. - The transaction only applies the changes. It checks the compute row first: a compute deleted while libvirt was asked gets no instances (this ended in a foreign key error before). A failed listing still leaves the database untouched. With the change, the same reproduction writes the sessions at once and keeps the instances. Both new tests fail on the previous code. |
||
|---|---|---|
| .. | ||
| api | ||
| migrations | ||
| templates | ||
| __init__.py | ||
| apps.py | ||
| forms.py | ||
| models.py | ||
| test_api_security.py | ||
| test_operation_locks.py | ||
| test_ownership.py | ||
| test_quota_down_host.py | ||
| test_reconciliation.py | ||
| tests.py | ||
| urls.py | ||
| utils.py | ||
| validators.py | ||
| views.py | ||