From 05204881f2d37cf2f8bd5da190be3a157e775a8c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 13 Mar 2020 07:24:09 -0500 Subject: [PATCH] ceph.in: use os._exit when we don't shut down 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 --- src/ceph.in | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ceph.in b/src/ceph.in index 9ff04ea3a40c..aedec606fb5d 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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) -- 2.47.3