Commit 6d5299fe authored by Felipe Pina's avatar Felipe Pina
Browse files

[BGCSGRID-483] Não retornar comandos FINISHED

Não retornar comandos com o estado FINISHED na chamada de verificação do status de comandos, pois os comando finalizados são notificados pelo SGA.
Showing with 20 additions and 47 deletions
+20 -47
......@@ -209,66 +209,39 @@ posix.actions = {
local processes = {}
self.logger:debug("Got a status request for command " .. job.jid .. " (pid " ..job.data.pid .. ")")
-- If command is running, returns information for all processes under the command
if is_command_alive(self, job) then
for pid in process_tree(job.data.pid) do
local pinfo = procdata.get_process_info(pid)
-- FIXME return more information, don't return fake information
processes[#processes + 1] = {
pid = pid,
ppid = pinfo.ppid,
exec_host = "",
string = pinfo.comm,
state = "RUNNING",
processor_id = "",
memory_ram_size_mb = pinfo.rss / (1024 * 1024),
memory_swap_size_mb = 0,
cpu_perc = 0,
cpu_time_sec = 0,
wall_time_sec = pinfo.walltime,
system_time_sec = pinfo.stime,
user_time_sec = pinfo.utime,
virtual_memory_size_mb = pinfo.vmsize / (1024 * 1024),
bytes_in_kb = 0,
bytes_out_kb = 0,
disk_bytes_read_kb = 0,
disk_bytes_write_kb = 0,
}
end
for k,v in collect_exec_data(self, job) do
processes[1][k] = v
end
for k,v in pairs(logchunk.read(job)) do
processes[1][k] = v
end
-- If command has finished, returns information for parent process
else
processes[1] = {
pid = job.data.pid,
ppid = 0,
for pid in process_tree(job.data.pid) do
local pinfo = procdata.get_process_info(pid)
-- FIXME return more information, don't return fake information
processes[#processes + 1] = {
pid = pid,
ppid = pinfo.ppid,
exec_host = "",
string = 0,
state = "FINISHED",
string = pinfo.comm,
state = "RUNNING",
processor_id = "",
memory_ram_size_mb = job.data.pinfo and job.data.pinfo.rss
and job.data.pinfo.rss / (1024*1024) or 0,
memory_ram_size_mb = pinfo.rss / (1024 * 1024),
memory_swap_size_mb = 0,
cpu_perc = 0,
cpu_time_sec = 0,
wall_time_sec = job.data.pinfo and job.data.pinfo.walltime or 0,
system_time_sec = job.data.pinfo and job.data.stime or 0,
user_time_sec = job.data.pinfo and job.data.utime or 0,
virtual_memory_size_mb = job.data.pinfo and job.data.pinfo.vmsize
and job.data.pinfo.vmsize / (1024 * 1024) or 0,
wall_time_sec = pinfo.walltime,
system_time_sec = pinfo.stime,
user_time_sec = pinfo.utime,
virtual_memory_size_mb = pinfo.vmsize / (1024 * 1024),
bytes_in_kb = 0,
bytes_out_kb = 0,
disk_bytes_read_kb = 0,
disk_bytes_write_kb = 0,
}
end
for k,v in collect_exec_data(self, job) do
processes[1][k] = v
end
for k,v in pairs(logchunk.read(job)) do
processes[1][k] = v
end
return true, { processes = processes }
end,
}
--
......
Supports Markdown
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