SiyaoIsHiding commented on code in PR #462:
URL:
https://github.com/apache/cassandra-nodejs-driver/pull/462#discussion_r3360171807
##########
lib/control-connection.js:
##########
@@ -412,15 +408,13 @@ class ControlConnection extends events.EventEmitter {
// To acquire metadata we need to specify the cassandra version
this.metadata.setCassandraVersion(this.host.getCassandraVersion());
this.metadata.buildTokens(this.hosts);
+ }
- if (!this.options.isMetadataSyncEnabled) {
- this.metadata.initialized = true;
- return;
- }
-
+ if (isReconnecting && this.options.isMetadataSyncEnabled) {
await this.metadata.refreshKeyspacesInternal(false);
- this.metadata.initialized = true;
}
+
+ this.metadata.initialized = true;
Review Comment:
nit: this will have the side effect that if metadata sync is not enabled,
`this.metadata.initialized = true;` will still run everytime it refreshes, not
just once at initialization.
##########
lib/control-connection.js:
##########
@@ -225,15 +225,11 @@ class ControlConnection extends events.EventEmitter {
}
function startReconnecting(hostDown) {
- if (wasRefreshCalled++ !== 0) {
- // Prevent multiple calls to reconnect
- return;
- }
-
removeListeners();
+ // Don't attempt to reconnect when the ControlConnection is being
shutdown
if (self._isShuttingDown) {
- // Don't attempt to reconnect when the ControlConnection is being
shutdown
+ this.log('info', 'The ControlConnection will not be refreshed as the
Client is being shutdown');
Review Comment:
```suggestion
self.log('info', 'The ControlConnection will not be refreshed as the
Client is being shutdown');
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]