1
0
Fork 0

tuned-adm: Increase DBus call timeout to 40 seconds

Increase timeout for DBus method calls in tuned-adm to 40 seconds.
This is meant to prevent simultaneous timeouts in tuned-adm and
the tuned daemon.

Previously it could happen, that e.g.
 tuned-adm profile <name>
was executed, issuing a DBus call to the tuned daemon,
then in response the tuned daemon would issue a DBus
call to Polkit in order to authorize the profile switch request, and
this call would time out. The call to Polkit would time out after the
default DBus timeout of 25 seconds and simultaneously the tuned-adm's
call to tuned daemon would also time out, because the same default
timeout was used. After that, if the fallback authorization method
in tuned daemon succeeded, the daemon would start applying the new
profile, and at the same time tuned-adm would use the fallback method,
which is restarting tuned (systemctl restart tuned). This could
potentially lead to all sorts of race conditions. Let's avoid that
by increasing the timeout in tuned-adm, so that tuned has time
to apply a profile after a failed Polkit call.

Related: rhbz#1475571

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2017-09-07 16:03:59 +02:00
parent ab598cd6ef
commit bfab9d8d22

View file

@ -67,7 +67,7 @@ class DBusController(object):
try:
method = self._interface.get_dbus_method(method_name)
return method(*args, **kwargs)
return method(*args, timeout=40)
except dbus.exceptions.DBusException as dbus_exception:
err_str = "DBus call to Tuned daemon failed"
if self._debug: