From 5d9d1ef61b4052c0eafb7ba65bbba0901107d300 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Aug 2009 11:28:10 -0700 Subject: [PATCH] msgr: add ms_die_on_bad_msg option, make assert(0) conditional --- RELEASE_CHECKLIST | 2 +- src/config.cc | 1 + src/config.h | 1 + src/msg/Message.cc | 3 ++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE_CHECKLIST b/RELEASE_CHECKLIST index 3b8c9a6de01ed..2519405b453d8 100644 --- a/RELEASE_CHECKLIST +++ b/RELEASE_CHECKLIST @@ -7,8 +7,8 @@ - add entry to debian/changelog, with proper version - commit - git tag version -- make dist, upload to ceph.newdream.net:ceph.newdream.net/downloads - build debs for amd64, i386 +- make dist, upload to ceph.newdream.net:ceph.newdream.net/downloads - email ml + post news entry - rebase kclient_clean \ No newline at end of file diff --git a/src/config.cc b/src/config.cc index 6b3cd804f18d9..1cee555069d9e 100644 --- a/src/config.cc +++ b/src/config.cc @@ -345,6 +345,7 @@ static struct config_option config_optionsp[] = { OPTION(ms_fail_interval, 0, OPT_DOUBLE, 15.0), // fail after this long OPTION(ms_die_on_failure, 0, OPT_BOOL, false), OPTION(ms_nocrc, 0, OPT_BOOL, false), + OPTION(ms_die_on_bad_msg, 0, OPT_BOOL, false), OPTION(mon_data, 0, OPT_STR, ""), OPTION(mon_tick_interval, 0, OPT_INT, 5), OPTION(mon_osd_down_out_interval, 0, OPT_INT, 300), // seconds diff --git a/src/config.h b/src/config.h index 9b7597a838efa..6cde0ba9aab54 100644 --- a/src/config.h +++ b/src/config.h @@ -121,6 +121,7 @@ struct md_config_t { double ms_fail_interval; bool ms_die_on_failure; bool ms_nocrc; + bool ms_die_on_bad_msg; // mon const char *mon_data; diff --git a/src/msg/Message.cc b/src/msg/Message.cc index d3ec2bd6b13ec..018e217538046 100644 --- a/src/msg/Message.cc +++ b/src/msg/Message.cc @@ -495,7 +495,8 @@ Message *decode_message(ceph_msg_header& header, ceph_msg_footer& footer, catch (buffer::error *e) { dout(0) << "failed to decode message of type " << type << ": " << *e << dendl; delete e; - assert(0); + if (g_conf.ms_die_on_bad_msg) + assert(0); return 0; } -- 2.39.5