From 68134e2df9348fc5b28ab9d4b0e8c11df5cb8c63 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 4 Mar 2024 15:52:15 +0100 Subject: [PATCH] chore(NODE-5986): parallelize SRV/TXT resolution Just a small thing I noticed while looking at the driver code, this is a quick win to improve connection establishment performance. --- src/connection_string.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/connection_string.ts b/src/connection_string.ts index fdc4e47ab22..e6ae0b82b2f 100644 --- a/src/connection_string.ts +++ b/src/connection_string.ts @@ -68,8 +68,15 @@ export async function resolveSRVRecord(options: MongoOptions): Promise { + /* rejections will be handled later */ + }); + + // Resolve the SRV record and use the result as the list of hosts to connect to. const addresses = await dns.promises.resolveSrv( `_${options.srvServiceName}._tcp.${lookupAddress}` ); @@ -88,10 +95,10 @@ export async function resolveSRVRecord(options: MongoOptions): Promise