diff options
author | mathisbessamdb <mathis.bessa@mongodb.com> | 2022-08-18 14:10:40 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-08-18 15:00:54 +0000 |
commit | e8e41877b7a33cb9922699259b6962f1e10ac995 (patch) | |
tree | 9d5f33cfeacf99640bd047626cd25d70776f82f9 /buildscripts | |
parent | f7d5fbf77702cf8ab293ccaa4639f41971115f72 (diff) | |
download | mongo-e8e41877b7a33cb9922699259b6962f1e10ac995.tar.gz |
SERVER-68909 Safely handle creating a client connection exception when checking for shard merge feature flag in passthrough
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/resmokelib/testing/hooks/tenant_migration.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/tenant_migration.py b/buildscripts/resmokelib/testing/hooks/tenant_migration.py index 82bfef99d91..122dcb534a2 100644 --- a/buildscripts/resmokelib/testing/hooks/tenant_migration.py +++ b/buildscripts/resmokelib/testing/hooks/tenant_migration.py @@ -443,13 +443,14 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst migration_opts.migration_id, migration_opts.get_donor_name()) raise - def _is_shard_merge_enabled(self, primary_client): # noqa: D205,D400 + def _is_shard_merge_enabled(self, donor_primary): # noqa: D205,D400 """Check if the shard merge feature flag is enabled. Returns true if both the shard merge feature flag is set to true and that ignoreShardMergeFeatureFlag is set to false. """ shard_merge_feature_enabled = False while True: try: + primary_client = self._create_client(donor_primary) shard_merge_flag_doc = primary_client.admin.command( {"getParameter": 1, "featureFlagShardMerge": 1}) fcv_doc = primary_client.admin.command( @@ -496,8 +497,7 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst get_certificate_and_private_key("jstests/libs/tenant_migration_recipient.pem"), } donor_primary = migration_opts.get_donor_primary() - donor_primary_client = self._create_client(donor_primary) - is_shard_merge_enabled = self._is_shard_merge_enabled(donor_primary_client) + is_shard_merge_enabled = self._is_shard_merge_enabled(donor_primary) if is_shard_merge_enabled: self._override_abort_failpoints(self._tenant_migration_fixture.common_mongod_options) cmd_obj["protocol"] = "shard merge" |