Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-419

Do not send messages that exceed server's 48,000,000 byte limit

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.3
    • Component/s: None
    • None
    • Environment:
      Linux, Debian, MongoDB 2.2.0

      Calling mycollection.insert() on a large array of objects, or even a single large object, can result in sending a message, with socket send(), that triggers the server-side error, whereby a received message > 48,000,000 bytes causes the recv() to fail as if there were a network error. The server has no way apparently to gracefully reject such large messages. Therefore the driver should detect when it is about to send a message > 48000000 bytes and issue an insert failure that can be handled appropriately.

      See the server source file src/mongo/util/net/message_port.cpp for the hardwired 48000000 limit and its effect to drop the connection and trigger network-related behavior in the client driver such as retry, which is doomed to fail in this kind of case.

      Further, this limit on the size of an insert should be documented.

      Small example is attached.

        1. bug.py
          0.6 kB

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            hin John Hinsdale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: