-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw: hold reloader using unique_ptr #36521
Conversation
instead of using optional<> for holding reloader, use unique_ptr<>. as `RGWRealmReloader` is neither trivially_copy_{assignable,constructible} nor is_trivially_move_{assignable, constructible}, because of the `Cond` member variable. but Clang++ and libc++ still tries to rely on a delgating copy constructor for constructing the optional<RGWRealmReloader> instance even the optional object is created `in_place`. in this change, to workaround this issue, reloader is instead constructed using make_unique<> Signed-off-by: Kefu Chai <kchai@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanx Kefu
This makes Nautilus compile just fine.
Would be nice to get this backported into Nautilus, but otherwise I'll carry it along in my FreeBSD patch set.
Only the patch offset is different:
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -565,8 +565,8 @@ int main(int argc, const char **argv)
// add a watcher to respond to realm configuration changes
RGWPeriodPusher pusher(store);
RGWFrontendPauser pauser(fes, implicit_tenant_context, &pusher);
- std::optional<RGWRealmReloader> reloader(std::in_place, store,
- service_map_meta, &pauser);
+ auto reloader = std::make_unique<RGWRealmReloader>(store,
+ service_map_meta, &pauser);
RGWRealmWatcher realm_watcher(g_ceph_context, store->svc.zone->get_realm());
realm_watcher.add_watcher(RGWRealmNotify::Reload, *reloader);
please file a tracker ticket to make sure it is backported after this change is approved and merged. |
Done. See https://tracker.ceph.com/issues/47113 (both backports are already in progress). |
@smithfarm thanks! |
instead of using optional<> for holding reloader, use unique_ptr<>.
as
RGWRealmReloader
is neithertrivially_copy_{assignable,constructible} nor
is_trivially_move_{assignable, constructible}, because of the
Cond
member variable. but Clang++ and libc++ still tries to rely on a
delgating copy constructor for constructing the
optional instance even the optional object is
created
in_place
.in this change, to workaround this issue, reloader is instead
constructed using make_unique<>
Signed-off-by: Kefu Chai kchai@redhat.com
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox