0fbc317 BE: Extend be_ptask_create() with control when to schedule next run after success

Authored and Committed by jhrozek 4 years ago
    BE: Extend be_ptask_create() with control when to schedule next run after success
    
    Related: https://pagure.io/SSSD/sssd/issue/4012
    
    be_ptask_create() used to always schedule the next periodical run
    "period" seconds after the previous run started. This is great for tasks
    that are short-lived like DNS updates because we know they will be
    executed really with the configured period.
    
    But the background refresh task can potentially take a very long time in
    which case the next run could have been scheduled almost immediately and
    as a result sssd_be would always be quite busy. It is better to have the
    option to schedule the next task period seconds after the last run has
    finished. This can lead to some inconsistency, but we can warn the
    admin about that.
    
    This patch so far does not change any of the existing calls to
    be_ptask_create(), just adds BE_PTASK_SCHEDULE_FROM_LAST as an
    additional parameter.
    
    Reviewed-by: Sumit Bose <sbose@redhat.com>
    
        
file modified
+2 -1
file modified
+4 -6
file modified
+23 -1
file modified
+3 -1