[SERVER-63472] Change uassert to iassert in intermediary futures error handling code Created: 09/Feb/22  Updated: 06/Dec/22

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

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Operating System: ALL
Participants:

 Description   

Acceptance criteria: investigate places where uassert exists in futures error handling pathways and change these uses to iassert to prevent unnecessary log emissions.

Original Text

I have noticed that whenever there is a user assertion, which leads to a slow query log entry, it is accompanied by about 9 lines of stack trace coming from the futures library, which are completely useless:

[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:04.557+01:00 D1 TRACKING [conn12] Cmd: insert, TrackingId: 62028b5015832ed34820fcc9
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.278+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/bson/bsonelement.h","line":937}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.279+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1087}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.279+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1104}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.279+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1087}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.279+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1104}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.280+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1087}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.280+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1087}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.280+01:00 D1 ASSERT   [conn12] User assertion {"error":"Location13111: field not found, expected type string","file":"src/mongo/util/future_impl.h","line":1087}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.281+01:00 D1 SHARDING [conn12] Exception thrown while processing command {"db":"test","headerId":839,"error":"Location13111: field not found, expected type string"}
[js_test:agg_explain_fmt] s20275| 2022-02-08T16:25:05.282+01:00 I  COMMAND  [conn12] Slow query {"type":"command","ns":"test.agg_explain_fmt","appName":"MongoDB Shell","command":{"insert":"agg_explain_fmt","ordered":true,"lsid":{"id":{"$uuid":"b19b2ab9-873a-4f53-b476-c3397212c295"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1644333900,"i":3}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"numYields":0,"ok":0,"errMsg":"field not found, expected type string","errName":"Location13111","errCode":13111,"reslen":251,"readConcern":{"level":"local","provenance":"implicitDefault"},"remote":"127.0.0.1:59312","protocol":"op_msg","durationMillis":741}

We should remove these extra lines, because they are very confusing or if they are there for debugging purposes, we should at least include the stack that actually threw the exception, not repetition of the futures library.


Generated at Thu Feb 08 05:57:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.