[SERVER-33445] Add signal handler to generate stack traces Created: 22/Feb/18  Updated: 29/Oct/23  Resolved: 15/Jan/20

Status: Closed
Project: Core Server
Component/s: Diagnostics
Affects Version/s: 3.4.13, 3.6.2
Fix Version/s: 4.3.3

Type: New Feature Priority: Major - P3
Reporter: Kevin Arhelger Assignee: Billy Donahue
Resolution: Fixed Votes: 9
Labels: SWDI, former-quick-wins, gm-ack
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File test.out.txt    
Issue Links:
Depends
depends on SERVER-36178 Evaluate adding -fasynchronous-unwind... Closed
depends on SERVER-36242 Use libunwind for backtraces Closed
is depended on by SERVER-34190 MongoDB process hangs after some rand... Closed
Documented
Related
is related to SERVER-48396 SIGUSR2 stack collection closes conne... Closed
is related to SERVER-33880 Log currentOp information to mongod log Backlog
is related to SERVER-31814 Log details of process which sent sig... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2018-06-18, Platforms 2018-07-02, Platforms 2018-07-16, Dev Tools 2019-09-09, Dev Tools 2019-10-21, Dev Tools 2019-11-18, Dev Tools 2019-12-02, Dev Tools 2019-12-16, Dev Tools 2019-12-30, Dev Tools 2020-01-13, Dev Tools 2020-01-27
Participants:
Case:

 Description   

Occasionally we need to capture the state of all threads for performance analysis.
Currently this requires installing `gdb` and running an external script.

I propose implementing a signal handler calling printStackTrace().

This would ease diagnostics as we can achieve the same result by issuing a kill signal.



 Comments   
Comment by Githook User [ 13/Jan/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-33445 fix markAsStackTraceProcessingThread race
Branch: master
https://github.com/mongodb/mongo/commit/efc08efe71bbb872382f174a439b8f288a0ecb3c

Comment by Billy Donahue [ 11/Dec/19 ]

Committed as
https://github.com/mongodb/mongo/commit/4f0b6507d4acd185b4c925c176a5693be339f364

... which has "SERVER-44345" as a typo in its git description so was misfiled by the jira bot.

Comment by Gregory McKeon (Inactive) [ 13/Sep/18 ]

This has turned out to be blocked on the third party upgrades project.

Comment by Bruce Lucas (Inactive) [ 14/Mar/18 ]

Similar to the request in SERVER-33880 it would be useful to collect stack traces at various times when we detect problems - for example, when clean shutdown is attempted but stalls.

Generated at Thu Feb 08 04:33:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.