Skip to content

Commit 73f04b8

Browse files
committed
CDRIVER-830 Much simpler reconnects.
1 parent 7280587 commit 73f04b8

9 files changed

+302
-386
lines changed

src/mongoc/mongoc-client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,8 +1225,9 @@ _mongoc_client_kill_cursor (mongoc_client_t *client,
12251225
rpc.kill_cursors.cursors = &cursor_id;
12261226
rpc.kill_cursors.n_cursors = 1;
12271227

1228+
/* don't attempt reconnect if server unavailable */
12281229
mongoc_cluster_sendv_to_server (&client->cluster, &rpc, 1, server_id,
1229-
NULL, &error);
1230+
NULL, false, &error);
12301231

12311232
EXIT;
12321233
}

src/mongoc/mongoc-cluster-private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ mongoc_cluster_sendv_to_server (mongoc_cluster_t *cluster,
131131
size_t rpcs_len,
132132
uint32_t server_id,
133133
const mongoc_write_concern_t *write_concern,
134+
bool reconnect_ok,
134135
bson_error_t *error);
135136

136137
bool
@@ -143,9 +144,8 @@ mongoc_cluster_try_recv (mongoc_cluster_t *cluster,
143144
mongoc_stream_t *
144145
mongoc_cluster_fetch_stream (mongoc_cluster_t *cluster,
145146
uint32_t server_id,
147+
bool reconnect_ok,
146148
bson_error_t *error);
147-
bool
148-
mongoc_cluster_node_reconnect (mongoc_cluster_t *cluster, uint32_t server_id, bson_error_t *error);
149149

150150
BSON_END_DECLS
151151

0 commit comments

Comments
 (0)