1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00
webvirtcloud/vrtManager
catborise eab27f8aba fix(vrtManager): the libvirt event loop starts per process, on first use
The connection manager registered libvirt's event implementation and
started the event loop thread when vrtManager.connection was imported.
novncd imports it and then forks a child per console (websockify's
multiprocessing), so every child was forked from a process with a
running libvirt thread, which libvirt does not support, and the child
had no loop thread of its own: keepalive never ran there. Measured in
the test setup: in such a child, a call on a host that went silent
still waited after 70 s.

- The loop starts with the first get_connection of a process. The
  state is per process and shared by all managers; libvirt's event
  implementation is registered once and a child inherits it.
- After a fork, the child renews the lock and starts its own loop on
  first use. It stops using the inherited connections, which are the
  parent's sockets, but keeps them: releasing them would run libvirt
  destructors in the child. No process connects before forking today
  (novncd's parent does not connect, gunicorn does not preload); this
  keeps such a case safe.

With the change, novncd's parent has no libvirt thread, the console
child starts its own, and the same call fails after 29 s with a
keepalive timeout. A test forks a real child; it fails without the
fork handling.
2026-10-05 14:41:31 +03:00
..
__init__.py Initial commit 2015-02-27 10:53:51 +02:00
connection.py fix(vrtManager): the libvirt event loop starts per process, on first use 2026-10-05 14:41:31 +03:00
create.py fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
hostdetails.py fix cpu_usage waiting for instance creation. 2023-05-18 14:35:19 +03:00
instance.py fix(instances): disk and agent channel changes on paused VMs 2026-10-04 17:10:49 +03:00
interface.py fix(interfaces): validate IPv6 address and gateway of host interfaces 2026-10-04 17:29:59 +03:00
libvirt-ssh fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
network.py feat(security): harden storage uploads and vrtManager snapshot XML handling 2026-09-27 13:28:17 +03:00
nwfilters.py format python code with black 2022-11-02 08:54:35 +03:00
rwlock.py fix(vrtManager): modernize rwlock for Python 3.12 compatibility and add tests 2026-09-24 21:49:52 +03:00
storage.py Detect RDB pools too 2025-03-14 10:31:40 +01:00
test_change_network.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_connection.py fix(vrtManager): the libvirt event loop starts per process, on first use 2026-10-05 14:41:31 +03:00
test_console_setters.py feat(console): VNC is the only console type 2026-10-04 01:08:11 +03:00
test_iso_media.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
test_live_connection.py fix(vrtManager): libvirt connections open within a time limit 2026-10-05 09:06:52 +03:00
test_network_ip.py test: expand unit test coverage across admin, accounts, vrtManager, logs, appsettings, and datasource 2026-09-25 11:26:53 +03:00
test_persistent_edits.py fix(instances): disk and agent channel changes on paused VMs 2026-10-04 17:10:49 +03:00
test_resize_disk.py fix(instances): domain edits start from the persistent definition 2026-10-04 01:08:11 +03:00
test_rwlock.py ci: replace super-linter with ruff 2026-10-04 01:08:11 +03:00
test_util.py fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
test_xml_safety.py chore: drop references to the local roadmap from code and tests 2026-10-04 11:09:25 +03:00
util.py fix(instances): CD-ROM bus, USB controller and MACs of a new VM 2026-10-04 18:33:28 +03:00
virtsecrets.py Django 3.2.4 LTS upgrade 2021-06-15 13:28:47 +03:00