watcher: handle full and drained queue cases
authorIustin Pop <iustin@google.com>
Mon, 25 May 2009 10:52:20 +0000 (12:52 +0200)
committerIustin Pop <iustin@google.com>
Mon, 25 May 2009 11:19:49 +0000 (13:19 +0200)
commit24edc6d4de0c388ca3c4faa790479a66100e89e6
treea52c8d062227ebb156b87f7aa4396ba7a6e15845
parent59b4eeeff69ac46a3877a89ed2d9e25d372d1a30
watcher: handle full and drained queue cases

Currently the watcher is broken when the queue is full, thus not
fulfilling its job as a queue cleaner. It also doesn't handle nicely the
queue drained status.

This patch does a few changes:
  - first archive jobs, and only after submit jobs; this fixes the case
    where the queue is already full and there are jobs suited for
    archiving (but not the case where the jobs all too young to be
    archived)
  - handle nicely the job queue full and drained cases—instead of
    tracebacks, log such cases nicely
  - reverse the initial value and special cases for update_file; we now
    whitelist instead of blacklist cases, since we have much more
    blacklist cases than vice versa, and we set the flag to True only
    after the run is successful

The last change, especially, is a significant one: now errors during the
watcher run will not update the status file, and thus they won't be lost
again in the logs.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
daemons/ganeti-watcher