]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ms/async/ProtocolV2: add ms_die_on_bug and assert rxbuf/txbuf don't get big
authorSage Weil <sage@redhat.com>
Fri, 15 Mar 2019 11:27:17 +0000 (06:27 -0500)
committerSage Weil <sage@redhat.com>
Fri, 15 Mar 2019 11:42:29 +0000 (06:42 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/tasks/ceph.conf.template
src/common/legacy_config_opts.h
src/common/options.cc
src/msg/async/ProtocolV2.cc

index 4fbd813f160fe21cd8119be55c7a6a176646d894..2566000ad17b94e6931243c1998c3aefa1593fc3 100644 (file)
@@ -11,6 +11,7 @@
         auth debug = true
 
        ms die on old message = true
+       ms die on bug = true
 
        mon pg warn min per osd = 1
        mon pg warn max per osd = 10000   # <= luminous
index 2167088687714c0526d3cb2eb31531dda2a7cae0..fd1df2228384aa575c13baeb35cf844c658c8d34 100644 (file)
@@ -125,6 +125,7 @@ OPTION(ms_die_on_bad_msg, OPT_BOOL)
 OPTION(ms_die_on_unhandled_msg, OPT_BOOL)
 OPTION(ms_die_on_old_message, OPT_BOOL)     // assert if we get a dup incoming message and shouldn't have (may be triggered by pre-541cd3c64be0dfa04e8a2df39422e0eb9541a428 code)
 OPTION(ms_die_on_skipped_message, OPT_BOOL)  // assert if we skip a seq (kernel client does this intentionally)
+OPTION(ms_die_on_bug, OPT_BOOL)
 OPTION(ms_dispatch_throttle_bytes, OPT_U64)
 OPTION(ms_bind_ipv6, OPT_BOOL)
 OPTION(ms_bind_port_min, OPT_INT)
index 8e2f94bfca41025c77bbcd3e3481ba7d7a4ecbf9..6efea438257c5e2baeec4f80b0e9ab0b6bfa110b 100644 (file)
@@ -930,6 +930,10 @@ std::vector<Option> get_global_options() {
     .set_default(false)
     .set_description("Induce a daemon crash/exit if sender skips a message sequence number"),
 
+    Option("ms_die_on_bug", Option::TYPE_BOOL, Option::LEVEL_DEV)
+    .set_default(false)
+    .set_description("Induce a crash/exit on various bugs (for testing purposes)"),
+
     Option("ms_dispatch_throttle_bytes", Option::TYPE_SIZE, Option::LEVEL_ADVANCED)
     .set_default(100_M)
     .set_description("Limit messages that are read off the network but still being processed"),
index ed739d63eb43528067ef08dca94d16b5faaadfd0..8a90ffcaec5374fcad7c5732e6d9117862c54985 100644 (file)
@@ -710,6 +710,8 @@ CtPtr ProtocolV2::read(CONTINUATION_RXBPTR_TYPE<ProtocolV2> &next,
     [&next, this](char *buffer, int r) {
       if (unlikely(pre_auth.enabled) && r >= 0) {
         pre_auth.rxbuf.append(*next.node);
+       ceph_assert(!cct->_conf->ms_die_on_bug ||
+                   pre_auth.rxbuf.length() < 1000000);
       }
       next.r = r;
       run_continuation(next);
@@ -718,6 +720,8 @@ CtPtr ProtocolV2::read(CONTINUATION_RXBPTR_TYPE<ProtocolV2> &next,
     // error or done synchronously
     if (unlikely(pre_auth.enabled) && r >= 0) {
       pre_auth.rxbuf.append(*next.node);
+      ceph_assert(!cct->_conf->ms_die_on_bug ||
+                 pre_auth.rxbuf.length() < 1000000);
     }
     next.r = r;
     return &next;
@@ -739,6 +743,8 @@ CtPtr ProtocolV2::write(const std::string &desc,
                         bufferlist &buffer) {
   if (unlikely(pre_auth.enabled)) {
     pre_auth.txbuf.append(buffer);
+    ceph_assert(!cct->_conf->ms_die_on_bug ||
+               pre_auth.txbuf.length() < 1000000);
   }
 
   ssize_t r =