]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.in: use os._exit when we don't shut down 33950/head
authorSage Weil <sage@redhat.com>
Fri, 13 Mar 2020 12:24:09 +0000 (07:24 -0500)
committerSage Weil <sage@redhat.com>
Fri, 13 Mar 2020 18:29:14 +0000 (13:29 -0500)
If we experience a timeout, we don't bother shutting down rados, because
it can't currently handle one thread blocked (or running) library init
at the same time that another thread calls rados_shutdown().  This
behavior was recently introduced by c8f353c50bcd2a30be9e3600dba91912b8cd0429

However, sys.exit() runs all kinds of shutdown work that will also
interfere with the running librados threads.

Fix by using os._exit instead of sys.exit.

Fixes: https://tracker.ceph.com/issues/44566
Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph.in

index 9ff04ea3a40c80aedc02ca3508af318c43fe8901..aedec606fb5ddf9ed0f8eb1ffa6a4e22a8f65bb4 100755 (executable)
@@ -1279,4 +1279,11 @@ if __name__ == '__main__':
     except KeyboardInterrupt:
         print('Interrupted')
         retval = errno.EINTR
-    sys.exit(retval)
+
+    if retval:
+        # flush explicitly because we aren't exiting in the usual way
+        sys.stdout.flush()
+        sys.stderr.flush()
+        os._exit(retval)
+    else:
+        sys.exit(retval)