1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/computes
catborise fbd780af02 fix(computes): instance sync asks libvirt outside the DB transaction
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.
2026-10-05 10:47:35 +03:00
..
api fix(api): typed URLs and accurate response schemas 2026-10-04 01:08:11 +03:00
migrations Added missing migrations 2020-06-15 12:38:44 +06:00
templates perf(instances): instance lists read a VM's info once per row 2026-10-05 10:17:47 +03:00
__init__.py Initial commit 2015-02-27 10:53:51 +02:00
apps.py fix: track migrations; installs apply them instead of generating them 2026-10-04 01:08:11 +03:00
forms.py format python code with black 2022-11-02 08:54:35 +03:00
models.py fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
test_api_security.py fix(instances): disk edits keep their XML; changes lock per VM 2026-10-04 01:08:11 +03:00
test_operation_locks.py fix(instances): disk edits keep their XML; changes lock per VM 2026-10-04 01:08:11 +03:00
test_ownership.py fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
test_quota_down_host.py fix(vrtManager): host_is_up returns a bool; slow hosts block no others 2026-10-04 01:08:11 +03:00
test_reconciliation.py fix(computes): instance sync asks libvirt outside the DB transaction 2026-10-05 10:47:35 +03:00
tests.py fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
urls.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
utils.py fix(computes): instance sync asks libvirt outside the DB transaction 2026-10-05 10:47:35 +03:00
validators.py format python code with black 2022-11-02 08:54:35 +03:00
views.py chore(computes): remove the unrouted video models view 2026-10-04 19:41:56 +03:00