From: Sage Weil Date: Fri, 13 Mar 2020 12:24:09 +0000 (-0500) Subject: ceph.in: use os._exit when we don't shut down X-Git-Tag: v15.2.0~51^2~5^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05204881f2d37cf2f8bd5da190be3a157e775a8c;p=ceph.git 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 --- 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)