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

service_state_machine.cpp should log a backtrace if there's an uncaught exception

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.7, 4.1.7
    • Component/s: Networking
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.0
    • Sprint:
      Service Arch 2018-10-22, Service Arch 2018-11-05, Service Arch 2018-11-19, Service Arch 2018-12-03, Service Arch 2018-12-17, Service Arch 2018-12-31, Service Arch 2019-01-14
    • Linked BF Score:
      16

      Description

      While the backtrace itself won't be particular helpful in debugging the failure (as the stack has already been unwound) it will make it so the automated tooling to extract relevant log messages can find the uncaught exception message. The only log message that appears is the following:

      [ReplicaSetFixture:job0:secondary2] 2018-05-20T12:58:19.763+0000 E NETWORK  [conn118] Uncaught std::exception: basic_string::_M_create, terminating
      

      https://logkeeper.mongodb.org/lobster/build/7b9af1499f010b4d302f9f2e2ec3ebba/all?f=10ReplicaSetFixture%3Ajob0%3Asecondary2&bookmarks=0%2C938783

      We could likely instead just call std::terminate() inside the catch-block as myTerminate() already logs details about the exception as well as a backtrace of where it was caught.

        Attachments

        1. exception_stack_trace_current.txt
          0.4 kB
        2. exception_stack_trace_new.txt
          40 kB
        3. exception_stack_trace_no_handler.txt
          41 kB

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: