|
|
|
@ -91,7 +91,7 @@ def search_worked_process2(clVars, filter_func=lambda x: True,
|
|
|
|
|
pids = clVars.Get('core.cl_core_pids_path')
|
|
|
|
|
for pidfile in listDirectory(pids, fullPath=True):
|
|
|
|
|
try:
|
|
|
|
|
status = pickle.load(open(pidfile), "rb")
|
|
|
|
|
status = pickle.load(open(pidfile, "rb"))
|
|
|
|
|
if status_filter(status) and filter_func(status):
|
|
|
|
|
pid_path = path.join("/proc", str(status['os_pid']))
|
|
|
|
|
if path.exists(pid_path):
|
|
|
|
@ -112,7 +112,7 @@ def get_pid_info(clVars, statuses=(ProcessStatus.Worked,)):
|
|
|
|
|
pids = clVars.Get('core.cl_core_pids_path')
|
|
|
|
|
for pidfile in listDirectory(pids, fullPath=True):
|
|
|
|
|
try:
|
|
|
|
|
status = pickle.load(open(pidfile), "rb")
|
|
|
|
|
status = pickle.load(open(pidfile, "rb"))
|
|
|
|
|
if status['status'] in statuses:
|
|
|
|
|
if path.exists(path.join("/proc", str(status['os_pid']))):
|
|
|
|
|
yield status
|
|
|
|
@ -123,7 +123,7 @@ def get_pid_info(clVars, statuses=(ProcessStatus.Worked,)):
|
|
|
|
|
|
|
|
|
|
# try:
|
|
|
|
|
# pidfile = path.join(pids,str(pid))
|
|
|
|
|
# status = pickle.load(open(pidfile), "rb")
|
|
|
|
|
# status = pickle.load(open(pidfile,"rb"))
|
|
|
|
|
# return status
|
|
|
|
|
# except (socket.error, ValueError, IOError, KeyError, EOFError, OSError):
|
|
|
|
|
# return None
|
|
|
|
@ -136,7 +136,7 @@ def clear_finished_pids(clVars):
|
|
|
|
|
pids = clVars.Get('core.cl_core_pids_path')
|
|
|
|
|
for pidfile in listDirectory(pids, fullPath=True):
|
|
|
|
|
try:
|
|
|
|
|
d = pickle.load(open(pidfile), "rb")
|
|
|
|
|
d = pickle.load(open(pidfile, "rb"))
|
|
|
|
|
if path.exists(path.join("/proc", str(d['os_pid']))):
|
|
|
|
|
continue
|
|
|
|
|
except Exception:
|
|
|
|
|