]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_daemon.py: stop early termination of sleep
authorDan Mick <dan.mick@redhat.com>
Tue, 18 Apr 2017 22:56:42 +0000 (15:56 -0700)
committerDan Mick <dan.mick@redhat.com>
Tue, 25 Apr 2017 23:19:02 +0000 (16:19 -0700)
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 <dan.mick@redhat.com>
src/pybind/ceph_daemon.py

index c039f064700c1baba32e82fd5e3a788e07786054..2f459c5a0a3b5d1968c3dde842c4e81a5d024099 100755 (executable)
@@ -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