Consider exception origin when counting assertions

XMLWordPrintableJSON

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

      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:
              [DO NOT USE] Backlog - Service Architecture
              Reporter:
              Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: