From 7afb05cacf9ef1f2b0cd8d6f988d8756fa30e117 Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 11 Feb 2022 12:32:43 -0800 Subject: [PATCH 1/5] initial changes --- .evergreen/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index d17054169f..b8fa686807 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1712,8 +1712,12 @@ tasks: commands: - func: "bootstrap mongo-orchestration" vars: + VERSION: "rapid" TOPOLOGY: "sharded_cluster" + LOAD_BALANCER: true - func: "run load-balancer" + vars: + LOAD_BALANCER: true - func: "run tests" - name: "test-fips-standalone" From 7ac2087b6963122266cfc80a9b4030d8755ff0b8 Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 11 Feb 2022 14:08:08 -0800 Subject: [PATCH 2/5] add in some stuff I forgot --- .evergreen/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index b8fa686807..9cbd991472 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -292,6 +292,7 @@ functions: DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \ ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \ REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ + LOAD_BALANCER=${TEST_LOADBALANCER} \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh # run-orchestration generates expansion file with the MONGODB_URI for the cluster - command: expansions.update @@ -1712,7 +1713,7 @@ tasks: commands: - func: "bootstrap mongo-orchestration" vars: - VERSION: "rapid" + VERSION: "latest" TOPOLOGY: "sharded_cluster" LOAD_BALANCER: true - func: "run load-balancer" From fa51f686b928042cab521fbc62a44af7102e7b90 Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 11 Feb 2022 14:46:50 -0800 Subject: [PATCH 3/5] should hopefully make it work...will probably need more tweaks --- .evergreen/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 9cbd991472..2a65324300 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -292,7 +292,7 @@ functions: DISABLE_TEST_COMMANDS=${DISABLE_TEST_COMMANDS} \ ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \ REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ - LOAD_BALANCER=${TEST_LOADBALANCER} \ + LOAD_BALANCER=${LOAD_BALANCER} \ bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh # run-orchestration generates expansion file with the MONGODB_URI for the cluster - command: expansions.update @@ -458,6 +458,7 @@ functions: fi if [ -n "${test_loadbalancer}" ]; then export TEST_LOADBALANCER=1 + export LOAD_BALANCER=1 export SINGLE_MONGOS_LB_URI="${SINGLE_MONGOS_LB_URI}" export MULTI_MONGOS_LB_URI="${MULTI_MONGOS_LB_URI}" fi From 0d82934cfb36597dbdbb3ef6a6f2190e565c5c87 Mon Sep 17 00:00:00 2001 From: julius Date: Sat, 12 Feb 2022 23:17:19 -0800 Subject: [PATCH 4/5] remove service id mocking --- pymongo/pool.py | 6 ------ test/__init__.py | 4 ---- 2 files changed, 10 deletions(-) diff --git a/pymongo/pool.py b/pymongo/pool.py index d616408ef8..141b64eb01 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -248,8 +248,6 @@ def _set_keepalive_times(sock): # main thread, to avoid the deadlock. See PYTHON-607. "foo".encode("idna") -# Remove after PYTHON-2712 -_MOCK_SERVICE_ID = False def _raise_connection_failure(address, error, msg_prefix=None): @@ -633,10 +631,6 @@ def _hello(self, cluster_time, topology_version, heartbeat_frequency): auth_ctx = None doc = self.command("admin", cmd, publish_events=False, exhaust_allowed=awaitable) - # PYTHON-2712 will remove this topologyVersion fallback logic. - if self.opts.load_balanced and _MOCK_SERVICE_ID: - process_id = doc.get("topologyVersion", {}).get("processId") - doc.setdefault("serviceId", process_id) if not self.opts.load_balanced: doc.pop("serviceId", None) hello = Hello(doc, awaitable=awaitable) diff --git a/test/__init__.py b/test/__init__.py index 32220cfff3..d75c011547 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -101,10 +101,6 @@ SINGLE_MONGOS_LB_URI = os.environ.get("SINGLE_MONGOS_LB_URI") MULTI_MONGOS_LB_URI = os.environ.get("MULTI_MONGOS_LB_URI") if TEST_LOADBALANCER: - # Remove after PYTHON-2712 - from pymongo import pool - - pool._MOCK_SERVICE_ID = True res = parse_uri(SINGLE_MONGOS_LB_URI or "") host, port = res["nodelist"][0] db_user = res["username"] or db_user From cd2485f1671eb3a83a33b3de0109a3fb046a2625 Mon Sep 17 00:00:00 2001 From: julius Date: Mon, 14 Feb 2022 05:22:59 -0800 Subject: [PATCH 5/5] fix precommit error --- pymongo/pool.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pymongo/pool.py b/pymongo/pool.py index 141b64eb01..61945e2d5b 100644 --- a/pymongo/pool.py +++ b/pymongo/pool.py @@ -249,7 +249,6 @@ def _set_keepalive_times(sock): "foo".encode("idna") - def _raise_connection_failure(address, error, msg_prefix=None): """Convert a socket.error to ConnectionFailure and raise it.""" host, port = address