doSafeLog is called unnecessarily when UserAssertAfterLog is used

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • N&O 2026-01-19
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      doSafeLog is called whenever a log statement throws an exception: https://github.com/10gen/mongo/blob/27cf80da81947b9420cd8c04ed0ed240715e688f/src/mongo/logv2/log_detail.cpp#L334

      But sometimes we intend for a log statement to throw:

      https://github.com/10gen/mongo/blob/27cf80da81947b9420cd8c04ed0ed240715e688f/src/mongo/logv2/log_options.h#L43

      Meaning that we output the chatty doSafeLog output when we really do not need to, if 
      UserAssertAfterLog is in use.

            Assignee:
            Joseph Prince
            Reporter:
            Erin McNulty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: