From: Dan Mick Date: Tue, 18 Apr 2017 22:56:42 +0000 (-0700) Subject: pybind/ceph_daemon.py: stop early termination of sleep X-Git-Tag: v12.0.3~71^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc1bd7e91797a61694f4f8ebb3a0f62818ec5131;p=ceph.git pybind/ceph_daemon.py: stop early termination of sleep Any unignored signal will EINTR underneath and cause early return of sleep(). Fix that by sleeping until end time is reached. Signed-off-by: Dan Mick --- diff --git a/src/pybind/ceph_daemon.py b/src/pybind/ceph_daemon.py index c039f064700c..2f459c5a0a3b 100755 --- a/src/pybind/ceph_daemon.py +++ b/src/pybind/ceph_daemon.py @@ -341,6 +341,11 @@ class DaemonWatcher(object): break rows_since_header += 1 last_dump = dump - time.sleep(interval) + + # time.sleep() is interrupted by SIGWINCH; avoid that + end = time.time() + interval + while time.time() < end: + time.sleep(end - time.time()) + except KeyboardInterrupt: return