]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #16130 from fullerdj/wip-djf-ceph-connect-timeout
authorSage Weil <sage@newdream.net>
Thu, 13 Jul 2017 14:46:10 +0000 (09:46 -0500)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2017 14:46:10 +0000 (09:46 -0500)
ceph.in: Check return value when connecting

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Alfredo Deza <adeza@redhat.com>
1  2 
src/ceph.in

diff --cc src/ceph.in
index c9bef561e45d20b3cdf1fd513d15a2b3785ff605,96533520dad7397ecd2946e0e96e779ea3c77ce5..6a6672a8592f0c14744169d61cd68f901eee0426
@@@ -894,9 -897,12 +894,12 @@@ def main()
          # for completion let timeout be really small
          timeout = 3
      try:
 -        if childargs and childargs[0] == 'ping':
 +        if childargs and childargs[0] == 'ping' and not parsed_args.help:
              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