Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
@stbrody stbrody authored monkey101 committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 client/gridfs.cpp
View
6 client/gridfs.cpp
@@ -130,6 +130,12 @@ namespace mongo {
}
BSONObj GridFS::insertFile(const string& name, const OID& id, gridfs_offset length, const string& contentType) {
+ // Wait for any pending writebacks to finish
+ string err = _client.getLastError();
+ uassert( 16428,
+ str::stream() << "Error storing GridFS chunk for file: " << name
+ << ", error: " << err,
+ err == "" );
BSONObj res;
if ( ! _client.runCommand( _dbName.c_str() , BSON( "filemd5" << id << "root" << _prefix ) , res ) )
Please sign in to comment.
Something went wrong with that request. Please try again.