You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
2.0 KiB
50 lines
2.0 KiB
From 8776da7055d572fc6223eb6ce9ad4c3a5b2f925b Mon Sep 17 00:00:00 2001
|
|
From: Adam Williamson <awilliam@redhat.com>
|
|
Date: Tue, 13 Apr 2021 09:02:55 -0700
|
|
Subject: [PATCH] Re-connect to dbus for each call
|
|
|
|
By using the system bus and leaving our connection to it open
|
|
for the entire lifetime of the isotovideo process, we're setting
|
|
ourselves up to receive a lot of signals we don't deal with, and
|
|
just letting them accumulate. Since all we want to do is send a
|
|
signal and then go away, let's use a private socket, and
|
|
re-initialize the connection for each signal. The overhead of
|
|
doing this is not large, and we're sending small numbers of
|
|
signals per isotovideo process anyway (one signal per network on
|
|
startup, one signal at startup if a debug variable is set, and
|
|
one signal per network at end).
|
|
|
|
Thanks to @dvdhrm and @berrange for their help with this.
|
|
|
|
Related progress issue: https://progress.opensuse.org/issues/90872
|
|
---
|
|
backend/qemu.pm | 12 ++++++++----
|
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/backend/qemu.pm b/backend/qemu.pm
|
|
index 6c64f497..735e349c 100644
|
|
--- a/backend/qemu.pm
|
|
+++ b/backend/qemu.pm
|
|
@@ -135,10 +135,14 @@ sub stop_qemu {
|
|
|
|
sub _dbus_do_call {
|
|
my ($self, $fn, @args) = @_;
|
|
- $self->{dbus} ||= Net::DBus->system;
|
|
- $self->{dbus_service} ||= $self->{dbus}->get_service("org.opensuse.os_autoinst.switch");
|
|
- $self->{dbus_object} ||= $self->{dbus_service}->get_object("/switch", "org.opensuse.os_autoinst.switch");
|
|
- $self->{dbus_object}->$fn(@args);
|
|
+ # we intentionally do not persist the dbus connection to avoid
|
|
+ # queueing up signals we are not interested in handling:
|
|
+ # https://progress.opensuse.org/issues/90872
|
|
+ my $bus = Net::DBus->system(private => 1);
|
|
+ my $bus_service = $bus->get_service("org.opensuse.os_autoinst.switch");
|
|
+ my $bus_object = $bus_service->get_object("/switch", "org.opensuse.os_autoinst.switch");
|
|
+ $bus_object->$fn(@args);
|
|
+ $bus->get_connection->disconnect;
|
|
}
|
|
|
|
sub _dbus_call {
|
|
--
|
|
2.31.1
|
|
|