Skip to content

Commit d1c6507

Browse files
committed
fix c89 and scan-build
1 parent c23b3bf commit d1c6507

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/libmongoc/src/mongoc/mongoc-topology.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,7 @@ _mongoc_topology_do_blocking_scan (mongoc_topology_t *topology,
834834
{
835835
_mongoc_handshake_freeze ();
836836

837-
// LBTODO: don't even bother locking the mutex, note that this is for single-threaded clients only.
838837
bson_mutex_lock (&topology->mutex);
839-
// LBTODO if this is a load balanced cluster, then do not obey cooldown.
840838
mongoc_topology_scan_once (topology, true /* obey cooldown */);
841839
bson_mutex_unlock (&topology->mutex);
842840
mongoc_topology_scanner_get_error (topology->scanner, error);
@@ -1401,7 +1399,6 @@ _mongoc_topology_update_from_handshake (mongoc_topology_t *topology,
14011399

14021400
bson_mutex_lock (&topology->mutex);
14031401

1404-
// LBTODO: do not update the topology if this is load balanced mode.
14051402
if (topology->description.type == MONGOC_TOPOLOGY_LOAD_BALANCED) {
14061403
/* In load balanced mode, scanning is only for connection establishment. It must not modify the topology description. */
14071404
MONGOC_DEBUG ("Ignoring handshake response in load balanced mode");
@@ -1820,7 +1817,6 @@ _mongoc_topology_handle_app_error (mongoc_topology_t *topology,
18201817
}
18211818

18221819
if (type == MONGOC_SDAM_APP_ERROR_NETWORK) {
1823-
// LBTODO: bypass this in load balanced mode.
18241820
/* Mark server as unknown. */
18251821
mongoc_topology_description_invalidate_server (
18261822
&topology->description, server_id, why);
@@ -1836,7 +1832,6 @@ _mongoc_topology_handle_app_error (mongoc_topology_t *topology,
18361832
return false;
18371833
}
18381834
/* Mark server as unknown. */
1839-
// LBTODO: bypass this in load balanced mode.
18401835
mongoc_topology_description_invalidate_server (
18411836
&topology->description, server_id, why);
18421837
_mongoc_topology_clear_connection_pool (topology, server_id);
@@ -1891,7 +1886,6 @@ _mongoc_topology_handle_app_error (mongoc_topology_t *topology,
18911886
* error and the error's topologyVersion is strictly greater than the
18921887
* current ServerDescription's topologyVersion it MUST replace the
18931888
* server's description with a ServerDescription of type Unknown. */
1894-
// LBTODO: bypass this in load balanced mode.
18951889
mongoc_topology_description_invalidate_server (
18961890
&topology->description, server_id, &cmd_error);
18971891

src/libmongoc/tests/test-mongoc-loadbalanced.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ test_loadbalanced_cooldown_is_bypassed_single (void *unused)
391391
NULL /* read prefs */,
392392
NULL /* reply */,
393393
&error);
394+
BSON_ASSERT (!ok);
394395
ASSERT_ERROR_CONTAINS (
395396
error, MONGOC_ERROR_STREAM, MONGOC_ERROR_STREAM_SOCKET, "socket error");
396397

@@ -402,6 +403,7 @@ test_loadbalanced_cooldown_is_bypassed_single (void *unused)
402403
NULL /* read prefs */,
403404
NULL /* reply */,
404405
&error);
406+
BSON_ASSERT (!ok);
405407
ASSERT_ERROR_CONTAINS (error,
406408
MONGOC_ERROR_STREAM,
407409
MONGOC_ERROR_STREAM_NOT_ESTABLISHED,

0 commit comments

Comments
 (0)