Skip to content

Commit e5c978d

Browse files
committed
add missing _bulkwriteexception_set_error_reply
1 parent 77b30ed commit e5c978d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libmongoc/src/mongoc/mongoc-bulkwrite.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,8 +1500,8 @@ mongoc_bulkwrite_execute (mongoc_bulkwrite_t *self, const mongoc_bulkwriteopts_t
15001500
payload->size = (int32_t) ops_byte_len;
15011501
}
15021502

1503-
// Check if stream is valid. `mongoc_cluster_run_retryable_write` may have invalidated stream (e.g. due to
1504-
// processing an error). If invalid, select a new stream before processing more batches.
1503+
// Check if stream is valid. A previous call to `mongoc_cluster_run_retryable_write` may have invalidated
1504+
// stream (e.g. due to processing an error). If invalid, select a new stream before processing more batches.
15051505
if (!mongoc_cluster_stream_valid (&self->client->cluster, parts.assembled.server_stream)) {
15061506
bson_t reply;
15071507
// Select a server and create a stream again.
@@ -1513,6 +1513,8 @@ mongoc_bulkwrite_execute (mongoc_bulkwrite_t *self, const mongoc_bulkwriteopts_t
15131513
parts.assembled.server_stream = ss;
15141514
} else {
15151515
_bulkwriteexception_set_error (ret.exc, &error);
1516+
_bulkwriteexception_set_error_reply (ret.exc, &reply);
1517+
bson_destroy (&reply);
15161518
goto batch_fail;
15171519
}
15181520
}

0 commit comments

Comments
 (0)