Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make C++ driver call GLE after storing gridFS chunks, before calling …

…filemd5. SERVER-6742

This ensures that there are no pending writebacks from the chunks being inserted.
  • Loading branch information...
commit 5eaf375b0c9e6fef220e71916e83c3c3e265158f 1 parent 0786517
Spencer T Brody authored August 09, 2012 monkey101 committed October 15, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  client/gridfs.cpp
6  client/gridfs.cpp
@@ -130,6 +130,12 @@ namespace mongo {
130 130
     }
131 131
 
132 132
     BSONObj GridFS::insertFile(const string& name, const OID& id, gridfs_offset length, const string& contentType) {
  133
+        // Wait for any pending writebacks to finish
  134
+        string err = _client.getLastError();
  135
+        uassert( 16428,
  136
+                 str::stream() << "Error storing GridFS chunk for file: " << name
  137
+                               << ", error: " << err,
  138
+                 err == "" );
133 139
 
134 140
         BSONObj res;
135 141
         if ( ! _client.runCommand( _dbName.c_str() , BSON( "filemd5" << id << "root" << _prefix ) , res ) )

0 notes on commit 5eaf375

Please sign in to comment.
Something went wrong with that request. Please try again.