Blame SOURCES/0001-subman-Increase-RHSM-dbus-call-timeouts.patch

1ff027
From 298355d8b3d5a85b99e74a06e936a0113797bf2a Mon Sep 17 00:00:00 2001
1ff027
From: Kalev Lember <klember@redhat.com>
1ff027
Date: Fri, 28 Jun 2019 18:10:36 +0200
1ff027
Subject: [PATCH] subman: Increase RHSM dbus call timeouts
1ff027
1ff027
Increase the dbus timeouts to 5 minutes as the register/unregister calls
1ff027
seem to routinely take more than a minute.
1ff027
---
1ff027
 plugins/subman/gsd-subman-helper.c | 17 ++++++++++++-----
1ff027
 1 file changed, 12 insertions(+), 5 deletions(-)
1ff027
1ff027
diff --git a/plugins/subman/gsd-subman-helper.c b/plugins/subman/gsd-subman-helper.c
1ff027
index 182f7190..af7a82e9 100644
1ff027
--- a/plugins/subman/gsd-subman-helper.c
1ff027
+++ b/plugins/subman/gsd-subman-helper.c
1ff027
@@ -28,6 +28,8 @@
1ff027
 #include <gio/gio.h>
1ff027
 #include <json-glib/json-glib.h>
1ff027
 
1ff027
+#define DBUS_TIMEOUT 300000 /* 5 minutes */
1ff027
+
1ff027
 static void
1ff027
 _helper_convert_error (const gchar *json_txt, GError **error)
1ff027
 {
1ff027
@@ -94,7 +96,8 @@ _helper_unregister (GError **error)
1ff027
 						     proxy_options,
1ff027
 						     ""), /* lang */
1ff027
 				      G_DBUS_CALL_FLAGS_NONE,
1ff027
-				      -1, NULL, error);
1ff027
+				      DBUS_TIMEOUT,
1ff027
+				      NULL, error);
1ff027
 	return res != NULL;
1ff027
 }
1ff027
 
1ff027
@@ -127,7 +130,8 @@ _helper_auto_attach (GError **error)
1ff027
 						     proxy_options,
1ff027
 						     ""), /* lang */
1ff027
 				      G_DBUS_CALL_FLAGS_NONE,
1ff027
-				      -1, NULL, error);
1ff027
+				      DBUS_TIMEOUT,
1ff027
+				      NULL, error);
1ff027
 	if (res == NULL)
1ff027
 		return FALSE;
1ff027
 	g_variant_get (res, "(&s)", &str);
1ff027
@@ -158,7 +162,8 @@ _helper_save_config (const gchar *key, const gchar *value, GError **error)
1ff027
 						     g_variant_new_string (value),
1ff027
 						     ""), /* lang */
1ff027
 				      G_DBUS_CALL_FLAGS_NONE,
1ff027
-				      -1, NULL, error);
1ff027
+				      DBUS_TIMEOUT,
1ff027
+				      NULL, error);
1ff027
 	return res != NULL;
1ff027
 }
1ff027
 
1ff027
@@ -305,7 +310,8 @@ main (int argc, char *argv[])
1ff027
 							     subman_conopts,
1ff027
 							     userlang),
1ff027
 					      G_DBUS_CALL_FLAGS_NO_AUTO_START,
1ff027
-					      -1, NULL, &error_local);
1ff027
+					      DBUS_TIMEOUT,
1ff027
+					      NULL, &error_local);
1ff027
 		if (res == NULL) {
1ff027
 			g_dbus_error_strip_remote_error (error_local);
1ff027
 			_helper_convert_error (error_local->message, &error);
1ff027
@@ -339,7 +345,8 @@ main (int argc, char *argv[])
1ff027
 							     subman_conopts,
1ff027
 							     userlang),
1ff027
 					      G_DBUS_CALL_FLAGS_NO_AUTO_START,
1ff027
-					      -1, NULL, &error_local);
1ff027
+					      DBUS_TIMEOUT,
1ff027
+					      NULL, &error_local);
1ff027
 		if (res == NULL) {
1ff027
 			g_dbus_error_strip_remote_error (error_local);
1ff027
 			_helper_convert_error (error_local->message, &error);
1ff027
-- 
1ff027
2.21.0
1ff027