Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8541

The runtime monitor component still runs even when disabled

    • 3

      The issue can be reproduced by applying the following patch:

      --- a/test/cppsuite/configs/base_test_default.txt
      +++ b/test/cppsuite/configs/base_test_default.txt
      @@ -9,6 +9,7 @@ checkpoint_manager=
       ),
       runtime_monitor=
       (
      +    enabled=false,
           stat_cache_size=
           (
               enabled=true, 

      And then by running the following command:

      > ~/wiredtiger/build/test/cppsuite$ ./run -t base_test -l 2 

      You should see the following output:

      run: FAILED: bool test_harness::postrun_statistic_check::check_stat(test_harness::scoped_cursor&, const test_harness::postrun_statistic_check::postrun_statistic&) const/214: cursor.get() != nullptr
      run: process aborting
      WiredTiger Error: aborting WiredTiger library
      Aborted (core dumped)

      The crash occurs when the runtime monitor component is executing its {{}}finish function:

       void
      runtime_monitor::finish()
      {
          _postrun_stats.check(_cursor);
          component::finish();
      }

      The _cursor variable is initialized only if the component is enabled in the load function.

      The fix should be straightforward:

      --- a/test/cppsuite/test_harness/runtime_monitor.cxx
      +++ b/test/cppsuite/test_harness/runtime_monitor.cxx
      @@ -286,7 +286,8 @@ runtime_monitor::do_work()
       void
       runtime_monitor::finish()
       {
      -    _postrun_stats.check(_cursor);
      +    if (_enabled)
      +        _postrun_stats.check(_cursor);
           component::finish();

            Assignee:
            fiona.ochee@mongodb.com Fiona O'Chee (Inactive)
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: