Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2566

Server error ignored during GridFS chunk upload

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.13.0
    • Component/s: gridfs
    • Labels:
      None

      Description

      Found by Jeroen Ooms [X], possible bug in the C Driver's GridFS implementation. Using a free mLab account, uploading a 3.5MB file silently fails. The fs.files document is written with "length" equal to one chunk (255k), and no chunk is written at all. The GridFS API appears to return a success, however.

      This seems related to mLab storage limits. Once we dropped the database, uploads worked correctly.

      Either:
      1. The C Driver ignores an error that it should report when chunk-upload fails
      2. Jeroen's use of the C Driver ignores an error
      3. mLab acts weird when it a write would exceed the storage limit

      Jeroen, could you paste the C code that uploads a file and checks for error please?

      Update: #1 is correct. mongoc_gridfs_create_file_from_stream() ignores errors from mongoc_gridfs_file_writev while uploading chunks. I imagine that if an mLab user is too close to quota to save a chunk but still has space left for the fs.files record, that mongoc_gridfs_file_writev fails silently and mongoc_gridfs_file_save succeeds.

        Attachments

          Activity

            People

            Assignee:
            jesse A. Jesse Jiryu Davis
            Reporter:
            jesse A. Jesse Jiryu Davis
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: