URL: https://github.com/SSSD/sssd/pull/5423
Author: elkoniu
 Title: #5423: Offline timeout man update
Action: opened

PR body:
"""
In some circumstances offline_timeout and offline_timeout_max values may lead 
to a scenario in which user thinks that
the whole offline interval incrementing mechanics is not working according to 
logs.
This is false positive error as in this kind of situation offline checking 
interval just instantly saturates.
This PR adds explanation to this kind of behavior to manual page of SSSD conf.
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/5423/head:pr5423
git checkout pr5423
From 9f721ddcc95d631f93dd2df34a777909be7f3182 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Po=C5=82awski?= <ppola...@redhat.com>
Date: Wed, 2 Dec 2020 03:00:26 +0100
Subject: [PATCH 1/2] data_provider_be: Add random offset default

Replace hardcoded default value of 30 with more meaningful
OFFLINE_TIMEOUT_RANDOM_OFFSET define.

This value is used to calculate task timeout during offline
status checking by formula (from SSSD MAN page):

new_interval = (old_interval * 2) + random_offset

As it is explicite mentioned in documentation it should
be expressed in the code similar way.
---
 src/providers/data_provider_be.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 4c10d6b480..10421c6b42 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -51,6 +51,7 @@
 #define ONLINE_CB_RETRY 3
 #define ONLINE_CB_RETRY_MAX_DELAY 4
 
+#define OFFLINE_TIMEOUT_RANDOM_OFFSET 30
 #define OFFLINE_TIMEOUT_DEFAULT 60
 #define OFFLINE_TIMEOUT_MAX_DEFAULT 3600
 
@@ -152,9 +153,13 @@ void be_mark_offline(struct be_ctx *ctx)
         offline_timeout = get_offline_timeout(ctx);
         offline_timeout_max = get_offline_timeout_max(ctx);
 
-        ret = be_ptask_create_sync(ctx, ctx,
-                                   offline_timeout, offline_timeout,
-                                   offline_timeout, 30, offline_timeout,
+        ret = be_ptask_create_sync(ctx,
+                                   ctx,
+                                   offline_timeout,
+                                   offline_timeout,
+                                   offline_timeout,
+                                   OFFLINE_TIMEOUT_RANDOM_OFFSET,
+                                   offline_timeout,
                                    offline_timeout_max,
                                    try_to_go_online,
                                    ctx, "Check if online (periodic)",

From d844c22e1272575df701dbefd62f97c78331e93c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Po=C5=82awski?= <ppola...@redhat.com>
Date: Wed, 2 Dec 2020 03:10:50 +0100
Subject: [PATCH 2/2] data_provider_be: MAN page update

Updated description of parameters:
* offline_timeout
* offline_timeout_max

MAN page now explains that in some circumstances
corelation of offline_timeout and offline_timeout_max values
may lead to offline checking interval not incrementing.
This is a false positive error as in fact the value
just saturates almost instantly.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1884213
---
 src/man/sssd.conf.5.xml | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml
index d247400bfb..59a6cb904e 100644
--- a/src/man/sssd.conf.5.xml
+++ b/src/man/sssd.conf.5.xml
@@ -739,12 +739,12 @@
                              offline_timeout + random_offset
                         </para>
                         <para>
-                            The random offset can increment up to 30 seconds.
+                            The random offset value is from 0 to 30.
                             After each unsuccessful attempt to go online,
                             the new interval is recalculated by the following:
                         </para>
                         <para>
-                            new_interval = old_interval*2 + random_offset
+                            new_interval = (old_interval * 2) + random_offset
                         </para>
                         <para>
                             Note that the maximum length of each interval
@@ -769,6 +769,14 @@
                         <para>
                             A value of 0 disables the incrementing behaviour.
                         </para>
+                        <para>
+                            Value of this parameter should be set in corelation
+                            to offline_timeout parameter value.
+                            With offline_timeout set to 60 (default value) there is no point
+                            in setting offlinet_timeout_max to less than 120 as it will
+                            saturate instantly. General rule here should be to set
+                            offline_timeout_max to at least 4 * offline_timeout.
+                        </para>
                         <para>
                             Although a value between 0 and offline_timeout may be
                             specified, it has the effect of overriding the
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org

Reply via email to