Commit 734a2a7c authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Fix inconsistency in the LUXI protocol w.r.t. args



This inconsistency was found during rebalancing. Hbal failed because,
Ganeti couldn't load the opcode. After digging through the cause, an
inconsistency with the "args" field in the LUXI protocol was triggered
by the TemplateHaskell side where it's done uniformed.

For SubmitJob and SubmitManyJobs we treat args as one argument,
containing the job definition. In every other LUXI call args is actually
a list of arguments. This patch fixes this consistency.

This change is NOT backwards compatible.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent cce46164
......@@ -473,13 +473,13 @@ class Client(object):
def SubmitJob(self, ops):
ops_state = map(lambda op: op.__getstate__(), ops)
return self.CallMethod(REQ_SUBMIT_JOB, ops_state)
return self.CallMethod(REQ_SUBMIT_JOB, (ops_state, ))
def SubmitManyJobs(self, jobs):
jobs_state = []
for ops in jobs:
jobs_state.append([op.__getstate__() for op in ops])
return self.CallMethod(REQ_SUBMIT_MANY_JOBS, jobs_state)
return self.CallMethod(REQ_SUBMIT_MANY_JOBS, (jobs_state, ))
def CancelJob(self, job_id):
return self.CallMethod(REQ_CANCEL_JOB, (job_id, ))
......
......@@ -268,13 +268,15 @@ class ClientOps:
if method == luxi.REQ_SUBMIT_JOB:
logging.info("Received new job")
ops = [opcodes.OpCode.LoadOpCode(state) for state in args]
(job_def, ) = args
ops = [opcodes.OpCode.LoadOpCode(state) for state in job_def]
return queue.SubmitJob(ops)
if method == luxi.REQ_SUBMIT_MANY_JOBS:
logging.info("Received multiple jobs")
(job_defs, ) = args
jobs = []
for ops in args:
for ops in job_defs:
jobs.append([opcodes.OpCode.LoadOpCode(state) for state in ops])
return queue.SubmitManyJobs(jobs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment