We need to wrap the full decode section or we can abort the process
if there's an issue (which we may want to just skip by).
Signed-off-by: Greg Farnum <greg@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit
73289b34b0be5b6612e38944794d59b5e789f841)
::decode(type, p);
if (EVENT_NEW_ENCODING == type) {
- DECODE_START(1, p);
- ::decode(type, p);
- event = decode_event(bl, p, type);
- DECODE_FINISH(p);
+ try {
+ DECODE_START(1, p);
+ ::decode(type, p);
+ event = decode_event(bl, p, type);
+ DECODE_FINISH(p);
+ }
+ catch (const buffer::error &e) {
+ generic_dout(0) << "failed to decode LogEvent (type maybe " << type << ")" << dendl;
+ return NULL;
+ }
} else { // we are using classic encoding
event = decode_event(bl, p, type);
}