]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
pybind: simplify timeout handling in run_in_thread()
authorKefu Chai <kchai@redhat.com>
Wed, 24 Oct 2018 10:25:37 +0000 (18:25 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 24 Oct 2018 15:40:08 +0000 (23:40 +0800)
commit4d8fc26c8a3dc7d06c37242c27b0eaa261f8ee2f
tree964d2639131c3dc8011ccc073f0a9df3ec61bb64
parent86106ecb00df74be20e65698fb753042f2677945
pybind: simplify timeout handling in run_in_thread()

* no need to poll for thread exit, instead just use the timeout
  parameter of Thread.join()
* raise Exception("timed out") if times out
* do not catch KeyboardInterrupt in run_in_thread(), let
  the upper caller to take care of it. as run_in_thread()
  should always return the *retval* of the function, not a tuple
  representing an exception or failure.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/ceph_argparse.py