From: Abhishek Lekshmanan Date: Tue, 9 Oct 2018 11:52:22 +0000 (+0200) Subject: rgw: ES sync: wrap all the decode bls in try block X-Git-Tag: v13.2.6~21^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=58ba8479c37dde6253e46ef0086bc72c8654328e;p=ceph.git rgw: ES sync: wrap all the decode bls in try block since decode can throw, wrap all the try block Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 12b12ccea23871688cc4101c72f00b0575f1c01a) Conflicts: src/rgw/rgw_sync_module_es.cc - mimic uses val.begin() where master has val.cbegin() --- diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 9283d5336cd8..b6162c1c569a 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -480,6 +480,7 @@ struct es_obj_metadata { decode(policy, i); } catch (buffer::error& err) { ldout(cct, 0) << "ERROR: failed to decode acl for " << bucket_info.bucket << "/" << key << dendl; + continue; } const RGWAccessControlList& acl = policy.get_acl(); @@ -496,12 +497,24 @@ struct es_obj_metadata { } } } else if (attr_name == RGW_ATTR_TAGS) { - auto tags_bl = val.begin(); - decode(obj_tags, tags_bl); + try { + auto tags_bl = val.begin(); + decode(obj_tags, tags_bl); + } catch (buffer::error& err) { + ldout(cct,0) << "ERROR: failed to decode obj tags for " + << bucket_info.bucket << "/" << key << dendl; + continue; + } } else if (attr_name == RGW_ATTR_COMPRESSION) { RGWCompressionInfo cs_info; - auto vals_bl = val.begin(); - decode(cs_info, vals_bl); + try { + auto vals_bl = val.begin(); + decode(cs_info, vals_bl); + } catch (buffer::error& err) { + ldout(cct,0) << "ERROR: failed to decode compression attr for " + << bucket_info.bucket << "/" << key << dendl; + continue; + } out_attrs.emplace("compression",std::move(cs_info.compression_type)); } else { if (!is_sys_attr(attr_name)) {