Skip to content

rgw: RGWSI_Notify drains the finisher before deleting RGWWatchers - #65775

Merged
cbodley merged 5 commits into
ceph:mainfrom
cbodley:wip-73361
Oct 21, 2025
Merged

cbodley merged 5 commits into
ceph:mainfrom
cbodley:wip-73361

Conversation

@cbodley

@cbodley cbodley commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

the C_ReinitWatch context stores a pointer to RGWWatcher *watcher

RGWSI_Notify schedules C_ReinitWatch callbacks to run on the finisher thread, which can race with the destruction of those RGWWatchers in RGWSI_Notify::finalize_watch()

to avoid this race, delay the RGWWatcher deletions until after we've drained/stopped the finisher thread in RGWSI_Notify::shutdown()

Fixes: https://tracker.ceph.com/issues/73361

Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@cbodley
cbodley requested a review from a team as a code owner October 3, 2025 20:17
@cbodley cbodley added the bug-fix label Oct 3, 2025
Comment thread src/rgw/CMakeLists.txt
@@ -152,7 +152,6 @@ list(APPEND librgw_common_srcs

if(WITH_RADOSGW_RADOS)
list(APPEND librgw_common_srcs
services/svc_finisher.cc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@adamemerson

Copy link
Copy Markdown
Contributor

jenkins test make check

@cbodley

cbodley commented Oct 7, 2025

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/cbodley-2025-10-06_20:02:55-rgw-wip-73361-distro-default-gibba/ had lots of crashes because radosgw-admin would call RGWSI_Notify::shutdown() even if we never started it. added a couple more commits to make this a bit more sane

@github-actions

github-actions Bot commented Oct 8, 2025

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

RGWSI_Notify is the only user of RGWSI_Finisher, but doesn't "own" it.
this means RGWSI_Notify can't drain/stop the Finisher on shutdown to
guarantee the lifetime of contexts like C_ReinitWatch that it
schedules there

replace the use of RGWSI_Finisher with direct ownership of Finisher, and
drain/stop it at the end of RGWSI_Notify::shutdown()

Signed-off-by: Casey Bodley <[email protected]>
the `C_ReinitWatch` context stores a pointer to `RGWWatcher *watcher`

`RGWSI_Notify` schedules `C_ReinitWatch` callbacks to run on this
finisher thread, which can race with the destruction of those
`RGWWatchers` in `RGWSI_Notify::finalize_watch()`

to avoid this race, delay the `RGWWatcher` deletions until after we've
drained/stopped the Finisher thread in `RGWSI_Notify::shutdown()`

Fixes: https://tracker.ceph.com/issues/73361

Signed-off-by: Casey Bodley <[email protected]>
avoid allocating, initializing, and shutting down RGWSI_Notify if we
aren't going to start or use it

calling RGWSI_Notify::shutdown() without first calling
RGWSI_Notify::do_start() aborts in Finisher::stop() with:
> ceph_abort_msg("join on thread that was never started")

Signed-off-by: Casey Bodley <[email protected]>
RGWSI_Notify is only used internally by RGWSI_SysObj_Cache where the
dependency is injected to RGWSI_SysObj_Cache::init(). there's no need to
expose a pointer to RGWSI_Notify to the rest of the application,
especially now that it can be a nullptr

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test api

@cbodley
cbodley merged commit 0d84fdb into ceph:main Oct 21, 2025
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/18684688518

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants