chore: remove aliases#658
Conversation
7b13101 to
414b0e5
Compare
| identifyConnection(targetClient: ClientWrapper, connectionHostInfo: HostInfo | null): Promise<HostInfo | null>; | ||
|
|
||
| identifyConnection(targetClient: ClientWrapper, connectionHostInfo?: HostInfo | null): Promise<HostInfo | null>; |
There was a problem hiding this comment.
I don't think any of the plugin service implementations implement these? They only have the original version. The wrapper needs this one for the added value of host_id_cache_service
| private _isInTransaction: boolean = false; | ||
| private servicesContainer: FullServicesContainer; | ||
| protected hosts: HostInfo[] = []; | ||
| protected routedHostInfo: HostInfo | null; |
There was a problem hiding this comment.
Let's set this to null to start - otherwise it is undefined
| } | ||
| await this.pluginService.setCurrentClient(result, result.hostInfo); | ||
| const connectedHostInfo: HostInfo | null = this.pluginService.getRoutedHostInfo() ?? this.pluginService.getInitialConnectionHostInfo(); | ||
| await this.pluginService.setCurrentClient(result, connectedHostInfo); |
There was a problem hiding this comment.
we might need a null check for host info as I think setCurrentClient needs a non-null host info - same thing in pg client
| if (monitorContext.isHostUnhealthy) { | ||
| const monitoringHostInfo = await this.getMonitoringHostInfo(); | ||
| if (monitoringHostInfo) { | ||
| this.pluginService.setAvailability(monitoringHostInfo.allAliases, HostAvailability.NOT_AVAILABLE); |
There was a problem hiding this comment.
Was this supposed to be removed?
| key, | ||
| queue.filter((connWeakRef: WeakRef<ClientWrapper>) => connWeakRef?.deref() ?? null) | ||
| ); | ||
| for (const connectionList of OpenedConnectionTracker.openedConnections.values()) { |
There was a problem hiding this comment.
should we also remove keys in this list that have an empty queue?
| if (hostInfo.hostId) { | ||
| lastHost = this.trackConnection(hostInfo.hostId, client); | ||
| } | ||
| if (hostInfo.hostAndPort) { | ||
| lastHost = this.trackConnection(hostInfo.hostAndPort, client); | ||
| } |
There was a problem hiding this comment.
If this can add something to be tracked twice, are there any issues if we invalidate the connection twice in invalidateAllConnections?
Summary
Description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.