Skip to content

Commit dce728c

Browse files
committed
CDRIVER-588 avoid cluster_try_sendv
Avoid the use of cluster_try_sendv for healthy and unhealthy clusters. It just needlessly avoids reconnects and persists the same errors.
1 parent 208355d commit dce728c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/mongoc/mongoc-client.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,10 @@ _mongoc_client_sendv (mongoc_client_t *client,
443443

444444
switch (client->cluster.state) {
445445
case MONGOC_CLUSTER_STATE_BORN:
446-
return _mongoc_cluster_sendv(&client->cluster, rpcs, rpcs_len, hint,
447-
write_concern, read_prefs, error);
448446
case MONGOC_CLUSTER_STATE_HEALTHY:
449447
case MONGOC_CLUSTER_STATE_UNHEALTHY:
450-
return _mongoc_cluster_try_sendv(&client->cluster, rpcs, rpcs_len, hint,
451-
write_concern, read_prefs, error);
448+
return _mongoc_cluster_sendv(&client->cluster, rpcs, rpcs_len, hint,
449+
write_concern, read_prefs, error);
452450
case MONGOC_CLUSTER_STATE_DEAD:
453451
bson_set_error(error,
454452
MONGOC_ERROR_CLIENT,

0 commit comments

Comments
 (0)