[SERVER-73561] Consider exception origin when counting assertions Created: 02/Feb/23  Updated: 03/Jul/23  Resolved: 03/Jul/23

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

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

Issue Links:
Duplicate
Related
related to SERVER-78458 Allow statuses/assertions to have bot... Closed
is related to SERVER-60647 Increase of user assertions in 5.0.x Backlog
is related to SERVER-73524 Report a histogram of error codes rat... Open
Assigned Teams:
Service Arch
Sprint: Service Arch Prioritized List
Participants:

 Description   

The current implementation of our assertions could be susceptible to counting a unique exception multiple times, due to not considering the origin of the exception. Consider the following as an example:

auto future = []() -> Future<void> {
    try {
        uassert(someFuncThatReturnsStatus());
        return Status::OK();
    }
    catch (const DBException& ex) {
        return ex.toStatus();
    }
}();
auto status = future.getNoThrow();
uassert(status); 

We'll bump the counter for user-assertions twice, although there's only one exception in this code-path. We should consider the origin of the exception when counting assertions, to make the metrics more reliable.



 Comments   
Comment by Phoebe Du [ 03/Jul/23 ]

Turning this server ticket into a PM ticket:

https://jira.mongodb.org/browse/PM-3400

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