Skip to content

Commit 779a788

Browse files
committed
CXX-175 ensure bulk operation executed if write fails
1 parent 8f053b7 commit 779a788

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mongo/client/bulk_operation_builder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ namespace mongo {
6060
uassert(0, "Bulk operations cannot be executed without any operations",
6161
!_write_operations.empty());
6262

63+
_executed = true;
64+
6365
if (!_ordered)
6466
std::sort(_write_operations.begin(), _write_operations.end(), compare);
6567

@@ -69,8 +71,6 @@ namespace mongo {
6971
writeResult->_requiresDetailedInsertResults = true;
7072

7173
_client->_write(_ns, _write_operations, _ordered, writeConcern, writeResult);
72-
73-
_executed = true;
7474
}
7575

7676
void BulkOperationBuilder::enqueue(WriteOperation* operation) {

0 commit comments

Comments
 (0)