]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: return a tuple in run_in_thread() if interrupted 11532/head
authorJaveme <javaloveme@gmail.com>
Tue, 18 Oct 2016 12:54:24 +0000 (20:54 +0800)
committerJaveme <javaloveme@gmail.com>
Thu, 20 Oct 2016 08:34:51 +0000 (16:34 +0800)
Callers expect run_in_thread() to return a tuple, but it
returns an int. When interrupt the function it would raise
an iterable exception.

This patch fix the bug, and it would just output a message
like: "Error EINTR: Interrupted!"

Signed-off-by: Javeme <javaloveme@gmail.com>
src/pybind/ceph_argparse.py

index c3aef846e19e658889cef69ac8ef1c0d292afc31..b60e71fb1b5709c45e87cb27ea23dfc8888d4695 100644 (file)
@@ -1191,7 +1191,7 @@ def run_in_thread(target, *args, **kwargs):
         interrupt = True
 
     if interrupt:
-        t.retval = -errno.EINTR
+        t.retval = -errno.EINTR, None, 'Interrupted!'
     if t.exception:
         raise t.exception
     return t.retval