[SERVER-71964] Consider ignoring exceptions rethrown from future_impl.h from stacktrace-gathering induced by traceException server parameter Created: 08/Dec/22  Updated: 09/Dec/22

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: George Wangensteen Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

The server offers a traceExceptions server parameter (see https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.traceExceptions) that configures the server to log full stack-traces for every DBException thrown. Server engineers use this feature to debug jstests, and some jstests temporarily configure the parameter to be set to add diagnostic information for difficult BFs.

However, in async code, because the same exception is often caught and re-thrown by the future library multiple times as it propogates down a continuation chain, this can lead to the same exception being logged with a complete stack trace many times. This clutters the log and can make it more difficult to understand the control flow induced by the exception.

We should consider omitting these re-throws from the stacktrace-logging requirement when traceExceptions is enabled. We could also consider a more general solution to try and only show the intial stack trace of an exception that may be caught and re-thrown with additional context multiple times.    


Generated at Thu Feb 08 06:20:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.