dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From e4469fbdb3d5c53294c6514280ac75b847b3c61c Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 12 Dec 2018 22:28:15 -0800
Subject: [PATCH] sbus: use 120 second default timeout
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As discussed in #1654537, first login to a system as a FreeIPA
domain user now usually causes an expensive SELinux operation
to happen; this can take longer than the default bus message
timeout of 25 seconds. To deal with this for now, let's use a
120 second default timeout; this is a big hammer, but unless we
can refactor things to use a longer timeout just for that one
call, or make the actual operation take less time, there's not
much else we can do.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1654537

Resolves:
https://pagure.io/SSSD/sssd/issue/3909

Signed-off-by: Adam Williamson <awilliam@redhat.com>

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
---
 src/sbus/sbus_message.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sbus/sbus_message.h b/src/sbus/sbus_message.h
index e7b8fe594..7ae634ece 100644
--- a/src/sbus/sbus_message.h
+++ b/src/sbus/sbus_message.h
@@ -27,8 +27,10 @@
 #include "util/util.h"
 #include "sbus/sbus_errors.h"
 
-/* Use reasonable default timeout which is computed in libdbus */
-#define SBUS_MESSAGE_TIMEOUT -1
+/* Use longer default timeout than libdbus default due to expensive
+ * selinux operation: see https://bugzilla.redhat.com/show_bug.cgi?id=1654537
+ */
+#define SBUS_MESSAGE_TIMEOUT 120000
 
 /**
  * Bound message with a talloc context.
-- 
2.19.1