Commit e566ddbd authored by Iustin Pop's avatar Iustin Pop
Browse files

Add some more debugging info to masterd

This patch will log data about queries, which are today completely
invisible (at the default log level) in the master log file.

Reviewed-by: imsnah
parent f06d91f2
......@@ -209,62 +209,81 @@ class ClientOps:
# TODO: Parameter validation
if method == luxi.REQ_SUBMIT_JOB:"Received new job")
ops = [opcodes.OpCode.LoadOpCode(state) for state in args]
return queue.SubmitJob(ops)
elif method == luxi.REQ_CANCEL_JOB:
job_id = args"Received job cancel request for %s", job_id)
return queue.CancelJob(job_id)
elif method == luxi.REQ_ARCHIVE_JOB:
job_id = args"Received job archive request for %s", job_id)
return queue.ArchiveJob(job_id)
elif method == luxi.REQ_AUTOARCHIVE_JOBS:
(age, timeout) = args"Received job autoarchive request for age %s, timeout %s",
age, timeout)
return queue.AutoArchiveJobs(age, timeout)
elif method == luxi.REQ_WAIT_FOR_JOB_CHANGE:
(job_id, fields, prev_job_info, prev_log_serial, timeout) = args"Received job poll request for %s", job_id)
return queue.WaitForJobChanges(job_id, fields, prev_job_info,
prev_log_serial, timeout)
elif method == luxi.REQ_QUERY_JOBS:
(job_ids, fields) = args
if isinstance(job_ids, (tuple, list)) and job_ids:
msg = ", ".join(job_ids)
msg = str(job_ids)"Received job query request for %s", msg)
return queue.QueryJobs(job_ids, fields)
elif method == luxi.REQ_QUERY_INSTANCES:
(names, fields, use_locking) = args"Received instance query request for %s", names)
op = opcodes.OpQueryInstances(names=names, output_fields=fields,
return self._Query(op)
elif method == luxi.REQ_QUERY_NODES:
(names, fields, use_locking) = args"Received node query request for %s", names)
op = opcodes.OpQueryNodes(names=names, output_fields=fields,
return self._Query(op)
elif method == luxi.REQ_QUERY_EXPORTS:
nodes, use_locking = args"Received exports query request")
op = opcodes.OpQueryExports(nodes=nodes, use_locking=use_locking)
return self._Query(op)
elif method == luxi.REQ_QUERY_CONFIG_VALUES:
fields = args"Received config values query request for %s", fields)
op = opcodes.OpQueryConfigValues(output_fields=fields)
return self._Query(op)
elif method == luxi.REQ_QUERY_CLUSTER_INFO:"Received cluster info query request")
op = opcodes.OpQueryClusterInfo()
return self._Query(op)
elif method == luxi.REQ_QUEUE_SET_DRAIN_FLAG:
drain_flag = args"Received queue drain flag change request to %s",
return queue.SetDrainFlag(drain_flag)
raise ValueError("Invalid operation")"Received invalid request '%s'", method)
raise ValueError("Invalid operation '%s'" % method)
def _DummyLog(self, *args):
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