From: Ilya Dryomov Date: Fri, 27 Feb 2026 14:18:27 +0000 (+0100) Subject: qa/tasks: make rbd_mirror_thrash inherit from ThrasherGreenlet X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ebe3a0a43251b0f126497d4100bd1af9ca8afc5;p=ceph.git qa/tasks: make rbd_mirror_thrash inherit from ThrasherGreenlet Commit 21b4b89e5280 ("qa/tasks: watchdog terminate thrasher") made it required for a thrasher to have stop_and_join() method, but the preceding commit a035b5a22fb8 ("thrashers: standardize stop and join method names") missed to add it to rbd_mirror_thrash (whether as an ad-hoc implementation or by way of inheriting from ThrasherGreenlet). Later on, commit 783f0e3a9903 ("qa: Adding a new class for the daemonwatchdog to monitor") worsened the issue by expanding the use of stop_and_join() to all watchdog barks rather than just the case of a thrasher throwing an exception which is something that practically never happens. Fixes: https://tracker.ceph.com/issues/75200 Signed-off-by: Ilya Dryomov --- diff --git a/qa/tasks/rbd_mirror_thrash.py b/qa/tasks/rbd_mirror_thrash.py index a5b7ae71f54..f153ba47f0b 100644 --- a/qa/tasks/rbd_mirror_thrash.py +++ b/qa/tasks/rbd_mirror_thrash.py @@ -9,18 +9,14 @@ import signal import socket import time -from gevent import sleep -from gevent.greenlet import Greenlet -from gevent.event import Event - from teuthology.exceptions import CommandFailedError from teuthology.orchestra import run -from tasks.thrasher import Thrasher +from tasks.thrasher import ThrasherGreenlet log = logging.getLogger(__name__) -class RBDMirrorThrasher(Thrasher, Greenlet): +class RBDMirrorThrasher(ThrasherGreenlet): """ RBDMirrorThrasher:: @@ -71,7 +67,6 @@ class RBDMirrorThrasher(Thrasher, Greenlet): self.logger = log self.name = 'thrasher.rbd_mirror.[{cluster}]'.format(cluster = cluster) - self.stopping = Event() self.randomize = bool(self.config.get('randomize', True)) self.max_thrash = int(self.config.get('max_thrash', 1)) @@ -93,9 +88,6 @@ class RBDMirrorThrasher(Thrasher, Greenlet): """Write data to logger assigned to this RBDMirrorThrasher""" self.logger.info(x) - def stop(self): - self.stopping.set() - def do_thrash(self): """ Perform the random thrashing action @@ -106,16 +98,14 @@ class RBDMirrorThrasher(Thrasher, Greenlet): "kill": 0, } - while not self.stopping.is_set(): + while not self.is_stopped: delay = self.max_thrash_delay if self.randomize: delay = random.uniform(self.min_thrash_delay, self.max_thrash_delay) if delay > 0.0: self.log('waiting for {delay} secs before thrashing'.format(delay=delay)) - self.stopping.wait(delay) - if self.stopping.is_set(): - continue + self.sleep_unless_stopped(delay) killed_daemons = [] @@ -148,7 +138,7 @@ class RBDMirrorThrasher(Thrasher, Greenlet): delay = random.uniform(0.0, self.max_revive_delay) self.log('waiting for {delay} secs before reviving daemons'.format(delay=delay)) - sleep(delay) + self.sleep_unless_stopped(delay) for daemon in killed_daemons: self.log('waiting for {label}'.format(label=daemon.id_))