Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-616

Drivers must raise an error if response messageLength > ismaster.maxMessageSizeBytes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.0
    • Affects Version/s: None
    • Component/s: None

      When reading a response from the server, if header.messageLength is greater than ismaster.maxMessageSizeBytes a driver MUST raise an error and close the connection.

      If this is the first operation run on the server (e.g. the first ismaster command sent on first connection) use a hard coded value of 48MB, switching to ismaster.maxMessageSizeBytes once you have received a valid ismaster response.

      Original bug report continues below
      ---------------------------------------------

      The new find() command in MongoDB 3.2 can return documents that are larger then the configured maxBsonObjectSize (16777216 bytes).

      Drivers that validate the messageLength header from the server need to adjust their validation accordingly.

      I suggest we use the same logic as the server, which is rumored to do:
      maxBsonObjectSize + 16K

            Assignee:
            abraham.egnor@mongodb.com Abraham Egnor
            Reporter:
            alexander.golin@mongodb.com Alexander Golin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: