Skip to content
  • Michael Hanselmann's avatar
    masterd: Shutdown only once running jobs have been processed · 5483fd73
    Michael Hanselmann authored
    
    
    Until now, if masterd received a fatal signal, it would start shutting
    down immediately. In the meantime it would hang while jobs are still
    processed. Clients couldn't connect anymore to retrieve a jobs' status.
    
    This this patch masterd checks if any job is running before shutting
    down. If there is it'll check again every five seconds. Once all jobs
    are finished, it waits another five seconds to give clients a chance to
    retrieve the jobs' status. After that masterd will shutdown in a clean
    fashion.
    
    If a second signal is received the old behaviour is preserved.
    
    Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
    Reviewed-by: default avatarIustin Pop <iustin@google.com>
    5483fd73