Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-63472

Change uassert to iassert in intermediary futures error handling code

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Service Arch
    • ALL

      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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: