Commit 4c848b18 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

jqueue: Don't pass the list of nodes to SubmitJob anymore

The job queue now maintains its own list and is updated when
nodes are added or removed from the cluster.

Reviewed-by: iustinp
parent 8e00939c
...@@ -207,11 +207,7 @@ class ClientOps: ...@@ -207,11 +207,7 @@ class ClientOps:
if method == luxi.REQ_SUBMIT_JOB: if method == luxi.REQ_SUBMIT_JOB:
ops = [opcodes.OpCode.LoadOpCode(state) for state in args] ops = [opcodes.OpCode.LoadOpCode(state) for state in args]
# we need to compute the node list here, since from now on all return queue.SubmitJob(ops)
# operations require locks on the queue or the storage, and we
# shouldn't get another lock
node_list = self.server.context.cfg.GetNodeList()
return queue.SubmitJob(ops, node_list)
elif method == luxi.REQ_CANCEL_JOB: elif method == luxi.REQ_CANCEL_JOB:
job_id = args job_id = args
......
...@@ -362,7 +362,7 @@ class JobQueue(object): ...@@ -362,7 +362,7 @@ class JobQueue(object):
return str(job_id) return str(job_id)
def _NewSerialUnlocked(self, nodes): def _NewSerialUnlocked(self):
"""Generates a new job identifier. """Generates a new job identifier.
Job identifiers are unique during the lifetime of a cluster. Job identifiers are unique during the lifetime of a cluster.
...@@ -448,7 +448,7 @@ class JobQueue(object): ...@@ -448,7 +448,7 @@ class JobQueue(object):
@utils.LockedMethod @utils.LockedMethod
@_RequireOpenQueue @_RequireOpenQueue
def SubmitJob(self, ops, nodes): def SubmitJob(self, ops):
"""Create and store a new job. """Create and store a new job.
This enters the job into our job queue and also puts it on the new This enters the job into our job queue and also puts it on the new
...@@ -456,13 +456,10 @@ class JobQueue(object): ...@@ -456,13 +456,10 @@ class JobQueue(object):
@type ops: list @type ops: list
@param ops: The list of OpCodes that will become the new job. @param ops: The list of OpCodes that will become the new job.
@type nodes: list
@param nodes: The list of nodes to which the new job serial will be
distributed.
""" """
# Get job identifier # Get job identifier
job_id = self._NewSerialUnlocked(nodes) job_id = self._NewSerialUnlocked()
job = _QueuedJob(self, job_id, ops) job = _QueuedJob(self, job_id, ops)
# Write to disk # Write to disk
......
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