From fee8ea8bccb3e5960640337874006adf310e4629 Mon Sep 17 00:00:00 2001 From: Douglas Fuller Date: Wed, 5 Jul 2017 14:49:50 -0400 Subject: [PATCH] ceph.in: Check return value when connecting 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 --- src/ceph.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index a17a4cd4b23e..96533520dad7 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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 -- 2.47.3