Commit Graph

6 Commits

Author SHA1 Message Date
Balazs Gibizer e3203ce4d1 Fix ProviderTree copying with threading Lock
The threading Lock object cannot be copied so the ProviderTree cannot be
deep copied in threading mode. This patch adds custom pickling /
copying handlers to the ProviderTree class to ignore the lock from the
source and readd it in the destination object during pickling /
copying.

Note that ProviderTree uses a named lock which means all the instance of
the ProviderTree object in the same process uses a shared lock object.
The copy handlers ensures the same behavior during copying so the copy
will use the same shared lock as well.

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: I084e72ce81dd456d67c9046f37d1ccb01b9fa4ba
2025-12-24 01:37:02 +00:00
Balazs Gibizer eda6792632 Make libvirt Tpool proxying conditional
When running in eventlet mode we keep the original eventlet.tpool usage
but when running in threading mode we call the functions directly on the
thread of the caller.

The patch_tpool_proxy() logic is removed from the libvirt driver as it
was only needed for python old style classes which is not in use any
more in python3 and the issue is not reproducible any more with
virConnect even without the patching.

❯ python3
Python 3.12.10 (main, Apr  9 2025, 04:44:59) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import eventlet
>>> eventlet.monkey_patch()
>>> from nova.virt.libvirt import host
>>> h = host.Host(uri="qemu:///system")
>>> h.get_connection()
libvirt:  error : internal error: could not initialize domain event timer
URI qemu:///system does not support events: internal error: could not initialize domain event timer
<libvirt.virConnect object at 0x7f829e94c170>
>>> c = h.get_connection()
>>> str(c)
'<libvirt.virConnect object at 0x7f829e94c170>'
>>>

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: Ic60ab78cec2a9f9ba177568b69e738425e56cae1
2025-11-21 16:05:21 +01:00
Balazs Gibizer 8c8047ce2a Make RBD Tpool usage conditional
When running in eventlet mode we keep the original eventlet.tpool usage
but when running in threading mode we call the functions directly on the
thread of the caller.

Signed-off-by: Balazs Gibizer <gibi@redhat.com>
Change-Id: I08f257d49c87d0d8a87127f61157b1b0b5ca7b3c
2025-11-21 16:05:21 +01:00
Balazs Gibizer 520057663a [nova-tox-py312-threading]Ignore failing tests
There is two intermittently failing tests we need to ignore for now so
this patch extends the list.

Closes-Bug: #2125185

Change-Id: I8d440013c84ae1dac4e2a1f661fc31138944b032
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-09-19 10:58:36 +02:00
Balazs Gibizer 1318cd48a1 [test]RPC using threading or eventlet selectively
The nova test hardcoded to run the RPC servers in the test with eventlet
executor. We change that to be dynamic based on how the tests was
started it can use eventlet or threading.

This makes some of the so far hanging RPC dependent unit tests passing.

Change-Id: I5012122fe66d41459b68202e750391a1939d70d9
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-08-27 19:03:30 +02:00
Balazs Gibizer 83eed99a9f Run unit test with threading mode
The py312-threading tox target will run the currently working unit tests
with threading mode. We have an exclude list, those tests are
failing or hanging. Also the current test list might still have unstable
tests.

This also adds a non voting zuul job to run the new target.

Change-Id: Ibf41fede996fbf2ebaf6ae83df8cfde35acb2b7e
Signed-off-by: Balazs Gibizer <gibi@redhat.com>
2025-08-27 19:01:35 +02:00