]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: Check return value when connecting 16130/head
authorDouglas Fuller <dfuller@redhat.com>
Wed, 5 Jul 2017 18:49:50 +0000 (14:49 -0400)
committerDouglas Fuller <dfuller@redhat.com>
Tue, 11 Jul 2017 16:11:33 +0000 (11:11 -0500)
The initial RADOS connection may time out. Detect this condition
and return an error message to the user instead of looping forever.

Signed-off-by: Douglas Fuller <dfuller@redhat.com>
src/ceph.in

index a17a4cd4b23ef87348a908cdfeb719b31667ec86..96533520dad7397ecd2946e0e96e779ea3c77ce5 100755 (executable)
@@ -899,7 +899,10 @@ def main():
     try:
         if childargs and childargs[0] == 'ping':
             return ping_monitor(cluster_handle, childargs[1], timeout)
-        run_in_thread(cluster_handle.connect, timeout=timeout)
+        result = run_in_thread(cluster_handle.connect, timeout=timeout)
+        if type(result) is tuple and result[0] == -errno.EINTR:
+            print('Cluster connection interrupted or timed out', file=sys.stderr)
+            return 1
     except KeyboardInterrupt:
         print('Cluster connection aborted', file=sys.stderr)
         return 1