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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.7, 4.1.7
    • Affects Version/s: None
    • Component/s: Networking
    • None
    • Fully Compatible
    • v4.0
    • 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
    • 16

      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.

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

            Assignee:
            jonathan.ma@mongodb.com Jonathan Ma
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: