diff --git a/common/lib/connection_provider_manager.ts b/common/lib/connection_provider_manager.ts index f957a3ed..d19b722c 100644 --- a/common/lib/connection_provider_manager.ts +++ b/common/lib/connection_provider_manager.ts @@ -60,4 +60,8 @@ export class ConnectionProviderManager { return host; } + + getDefaultConnectionProvider(): ConnectionProvider { + return this.defaultProvider; + } } diff --git a/common/lib/plugins/default_plugin.ts b/common/lib/plugins/default_plugin.ts index 45751ece..459d3034 100644 --- a/common/lib/plugins/default_plugin.ts +++ b/common/lib/plugins/default_plugin.ts @@ -51,7 +51,7 @@ export class DefaultPlugin extends AbstractConnectionPlugin { isInitialConnection: boolean, forceConnectFunc: () => Promise ): Promise { - return await this.connectInternal(hostInfo, props, this.connectionProviderManager.getConnectionProvider(hostInfo, props)); + return await this.connectInternal(hostInfo, props, this.connectionProviderManager.getDefaultConnectionProvider()); } override initHostProvider( diff --git a/common/lib/utils/utils.ts b/common/lib/utils/utils.ts index 261ac3e3..68b817a0 100644 --- a/common/lib/utils/utils.ts +++ b/common/lib/utils/utils.ts @@ -57,6 +57,9 @@ export function maskProperties(props: Map) { if (maskedProperties.has(WrapperProperties.PASSWORD.name)) { maskedProperties.set(WrapperProperties.PASSWORD.name, "***"); } + // Remove connectionProvider property before displaying. AwsMysqlPoolClient.targetPool throws + // "TypeError: Converting circular structure to JSON" when sent to JSON.stringify. + maskedProperties.delete(WrapperProperties.CONNECTION_PROVIDER.name); return maskedProperties; } diff --git a/tests/integration/container/tests/read_write_splitting.test.ts b/tests/integration/container/tests/read_write_splitting.test.ts index c890047c..39bad76b 100644 --- a/tests/integration/container/tests/read_write_splitting.test.ts +++ b/tests/integration/container/tests/read_write_splitting.test.ts @@ -649,6 +649,7 @@ describe("aurora read write splitting", () => { for (let i = 0; i < numOverloadedReaderConnections; i++) { const readerConfig = await initDefaultConfig(env.databaseInfo.readerInstanceEndpoint, env.databaseInfo.instanceEndpointPort, false); readerConfig["arbitraryProp"] = "value" + i.toString(); + readerConfig["connectionProvider"] = provider; readerConfig["readerHostSelectorStrategy"] = "leastConnections"; const client = initClientFunc(readerConfig); await client.connect();