From: Casey Bodley Date: Sat, 24 Nov 2018 15:19:15 +0000 (-0500) Subject: rgw: add optional_yield to RGWSI_Notify X-Git-Tag: v15.0.0~26^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b16e5f3d93a2e7116504523625ae5499924ca7fe;p=ceph.git rgw: add optional_yield to RGWSI_Notify Signed-off-by: Casey Bodley --- diff --git a/src/rgw/services/svc_notify.cc b/src/rgw/services/svc_notify.cc index e557fa0fb0b9..f48b497b7fb9 100644 --- a/src/rgw/services/svc_notify.cc +++ b/src/rgw/services/svc_notify.cc @@ -353,23 +353,25 @@ void RGWSI_Notify::_set_enabled(bool status) } } -int RGWSI_Notify::distribute(const string& key, bufferlist& bl) +int RGWSI_Notify::distribute(const string& key, bufferlist& bl, + optional_yield y) { RGWSI_RADOS::Obj notify_obj = pick_control_obj(key); ldout(cct, 10) << "distributing notification oid=" << notify_obj.get_ref().obj << " bl.length()=" << bl.length() << dendl; - return robust_notify(notify_obj, bl); + return robust_notify(notify_obj, bl, y); } -int RGWSI_Notify::robust_notify(RGWSI_RADOS::Obj& notify_obj, bufferlist& bl) +int RGWSI_Notify::robust_notify(RGWSI_RADOS::Obj& notify_obj, bufferlist& bl, + optional_yield y) { // The reply of every machine that acks goes in here. boost::container::flat_set> acks; bufferlist rbl; // First, try to send, without being fancy about it. - auto r = notify_obj.notify(bl, 0, &rbl); + auto r = notify_obj.notify(bl, 0, &rbl, y); // If that doesn't work, get serious. if (r < 0) { @@ -409,7 +411,7 @@ int RGWSI_Notify::robust_notify(RGWSI_RADOS::Obj& notify_obj, bufferlist& bl) rbl.clear(); // Reset the timeouts, we're only concerned with new ones. timeouts.clear(); - r = notify_obj.notify(bl, 0, &rbl); + r = notify_obj.notify(bl, 0, &rbl, y); if (r < 0) { ldout(cct, 1) << "robust_notify: retry " << tries << " failed: " << cpp_strerror(-r) << dendl; diff --git a/src/rgw/services/svc_notify.h b/src/rgw/services/svc_notify.h index cd9d9eb89d97..306a5f337a4f 100644 --- a/src/rgw/services/svc_notify.h +++ b/src/rgw/services/svc_notify.h @@ -74,7 +74,8 @@ private: void _set_enabled(bool status); void set_enabled(bool status); - int robust_notify(RGWSI_RADOS::Obj& notify_obj, bufferlist& bl); + int robust_notify(RGWSI_RADOS::Obj& notify_obj, bufferlist& bl, + optional_yield y); void schedule_context(Context *c); public: @@ -91,7 +92,7 @@ public: virtual void set_enabled(bool status) = 0; }; - int distribute(const string& key, bufferlist& bl); + int distribute(const string& key, bufferlist& bl, optional_yield y); void register_watch_cb(CB *cb); };