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>
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)