Skip to content
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

Merged
merged 1 commit into from
Aug 22, 2020
Merged

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Aug 7, 2020

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 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

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

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

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>
Copy link
Contributor

@wjwithagen wjwithagen left a 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);

@tchaikov
Copy link
Contributor Author

tchaikov commented Aug 8, 2020

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.

please file a tracker ticket to make sure it is backported after this change is approved and merged.

@tchaikov tchaikov merged commit 8db888e into ceph:master Aug 22, 2020
@tchaikov tchaikov deleted the wip-rgw-optional branch August 22, 2020 18:02
@smithfarm
Copy link
Contributor

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).

@tchaikov
Copy link
Contributor Author

@smithfarm thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants