Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-73561

Consider exception origin when counting assertions

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch
    • Service Arch Prioritized List

      The current implementation of our assertions could be susceptible to counting a unique exception multiple times, due to not considering the origin of the exception. Consider the following as an example:

      auto future = []() -> Future<void> {
          try {
              uassert(someFuncThatReturnsStatus());
              return Status::OK();
          }
          catch (const DBException& ex) {
              return ex.toStatus();
          }
      }();
      auto status = future.getNoThrow();
      uassert(status); 
      

      We'll bump the counter for user-assertions twice, although there's only one exception in this code-path. We should consider the origin of the exception when counting assertions, to make the metrics more reliable.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: