Make WaitForJobChanges deal with long jobs
authorIustin Pop <iustin@google.com>
Fri, 29 Aug 2008 13:42:23 +0000 (13:42 +0000)
committerIustin Pop <iustin@google.com>
Fri, 29 Aug 2008 13:42:23 +0000 (13:42 +0000)
commit5c73520908a113583d7ff61f751a9cc4737a68b7
tree423df3c1934efa25c97d7424a383c7807ead1b0b
parent3fc175f00a673efa073fa52deac212afb6d5c215
Make WaitForJobChanges deal with long jobs

This patch alters the WaitForJobChanges luxi-RPC call to have a
configurable timeout, so that the call behaves nicely with long jobs
that have no update.

We do this by adding a timeout parameter in the RPC call, and returning
a special constant when the timeout is reached without an update. The
luxi client will repeatedly call the WaitForJobChanges until it gets a
real change. The timeout is hardcoded as half the RWTO value.

The patch also removes an unused variable (new_state) from the
WaitForJobChanges method.

Reviewed-by: imsnah,ultrotter
daemons/ganeti-masterd
lib/constants.py
lib/jqueue.py
lib/luxi.py