From: yangDL <455619311@qq.com> Date: Thu, 26 Apr 2018 06:53:08 +0000 (+0800) Subject: pybind/ceph_argparse.py:'timeout' must in kwargs when call run_in_thread X-Git-Tag: v13.1.0~46^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=35475e39e34f27863e4822dbdcf88084ae0e838a;p=ceph.git pybind/ceph_argparse.py:'timeout' must in kwargs when call run_in_thread timeout is ignored by C API, but is useful in python threads. Function "run_in_thread" get "timeout" from kwargs,but other functions passing "timeout" in args, so "timeout" is 0 forever in run_in_thread. It will be polling forever when cluster unhealthy until recv signal like ctrl+c or cluster become healthy. So pass 'timeout' like 'timeout=timeout' Signed-off-by: yangdeliu --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 858c689307fa..5e10447df3cc 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -1261,11 +1261,11 @@ def send_command(cluster, target=('mon', ''), cmd=None, inbuf=b'', timeout=0, print('submit {0} to osd.{1}'.format(cmd, osdid), file=sys.stderr) ret, outbuf, outs = run_in_thread( - cluster.osd_command, osdid, cmd, inbuf, timeout) + cluster.osd_command, osdid, cmd, inbuf, timeout=timeout) elif target[0] == 'mgr': ret, outbuf, outs = run_in_thread( - cluster.mgr_command, cmd, inbuf, timeout) + cluster.mgr_command, cmd, inbuf, timeout=timeout) elif target[0] == 'pg': pgid = target[1] @@ -1281,7 +1281,7 @@ def send_command(cluster, target=('mon', ''), cmd=None, inbuf=b'', timeout=0, print('submit {0} for pgid {1}'.format(cmd, pgid), file=sys.stderr) ret, outbuf, outs = run_in_thread( - cluster.pg_command, pgid, cmd, inbuf, timeout) + cluster.pg_command, pgid, cmd, inbuf, timeout=timeout) elif target[0] == 'mon': if verbose: @@ -1289,10 +1289,10 @@ def send_command(cluster, target=('mon', ''), cmd=None, inbuf=b'', timeout=0, file=sys.stderr) if len(target) < 2 or target[1] == '': ret, outbuf, outs = run_in_thread( - cluster.mon_command, cmd, inbuf, timeout) + cluster.mon_command, cmd, inbuf, timeout=timeout) else: ret, outbuf, outs = run_in_thread( - cluster.mon_command, cmd, inbuf, timeout, target[1]) + cluster.mon_command, cmd, inbuf, timeout=timeout, target=target[1]) elif target[0] == 'mds': mds_spec = target[1]