678f797 backend: more aggressive posting to Frontend

Authored and Committed by praiskup 4 years ago
    backend: more aggressive posting to Frontend
    
    Previously we attempted to contact Frontend 10 times with sleep(5)
    between attempts, and failed (in total 50s).  This however created
    inconsistencies in Frontend database if Frontend was unavailable longer
    than 50s (e.g. because some build finished in Worker, but the process
    failed to notify frontend about this fact => then build stayed in
    'running' state indefinitely until backend restarted the job).
    
    The new approach prolongs the "attempt" window from 50s to 120s, but
    also allows use to call 'FrontendClient.set_independent()' flag.  If
    this is enabled (in background Worker processes), the process will keep
    re-trying to contact frontend till it (a) _is_ possible to send the data
    correctly or (b) there's some client error.  Any other server/request
    error is considered to be a temporary issue.
    
    Fixes: #975
    Merges: #1021
    
        
file modified
+1 -1
file modified
+61 -31
file modified
+62 -22