]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
test/rbd_mirror: flush watch/notify callbacks in TestImageReplayer
authorIlya Dryomov <idryomov@gmail.com>
Mon, 17 Feb 2025 11:41:51 +0000 (12:41 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Sat, 22 Feb 2025 15:12:35 +0000 (16:12 +0100)
commit96a6cb3a4ffe1b047c51bc5afddad40dccc4dde8
treed786844a5eb752141ddc916c8c1e176f277650df
parent4652246b03ab4dc8f4d5f87b5cd2663d6cb8af74
test/rbd_mirror: flush watch/notify callbacks in TestImageReplayer

TestImageReplayer establishes its own (i.e. outside of the SUT code)
watch on the header of the remote image to be able to synchronize the
execution of the test with certain notifications.  This watch is
established before the remote image is opened and is teared down until
after the remote image is closed but while the image replayer is still
running.  The flush that is part of image close sequence thus isn't
guaranteed to cover all callbacks, especially for snapshot-based
mirroring where UnlinkPeerRequest spawned from Replayer::unlink_peer()
generates a notification on the remote image for each completed unlink.
Since TestImageReplayer further immediately deletes C_WatchCtx, pretty
much any test can segfault when C_WatchCtx::handle_notify() is invoked
by TestWatchNotify infrastructure.  Because it's a virtual method, the
segfault often involves a completely bogus instruction pointer:

  fn_anonymous[3176255]: segfault at b ip 000000000000000b sp 00007fffbceba7a8 error 14 in unittest_rbd_mirror[555555554000+96a000]
  Code: Bad RIP value.

Fixes: https://tracker.ceph.com/issues/63798
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 5d111e23b89228d75daeada65067765333eefb73)
src/test/rbd_mirror/test_ImageReplayer.cc