toptobes commented on code in PR #462:
URL:
https://github.com/apache/cassandra-nodejs-driver/pull/462#discussion_r3270705036
##########
lib/control-connection.js:
##########
@@ -446,13 +441,31 @@ class ControlConnection extends events.EventEmitter {
}
/**
- * Acquires a new connection and refreshes topology and keyspace metadata.
+ * Acquires a new connection and refreshes topology and keyspace metadata,
with protection against concurrent refreshes.
* <p>When it fails obtaining a connection and there aren't any more hosts,
it schedules reconnection.</p>
* <p>When it fails obtaining the metadata, it marks connection and/or host
unusable and retries using the same
* iterator from query plan / host list</p>
* @param {Iterator<Host>} [hostIterator]
*/
async _refresh(hostIterator) {
+ if (this._refreshInProgress) {
+ return;
+ }
+ this._refreshInProgress = true;
+
+ try {
+ return await this._unsafeDoRefresh(hostIterator)
+ } finally {
+ this._refreshInProgress = false;
+ }
Review Comment:
`_refresh()` is never actually awaited
--
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]