Skip to content

Commit

Permalink
refactor: more pool cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakp committed Aug 26, 2022
1 parent d8fbd29 commit 27c6327
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmap/connection_pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
* Set the pool state to "ready"
*/
ready(): void {
if (this[kPoolState] === PoolState.ready) {
if (this[kPoolState] !== PoolState.paused) {
return;
}
this[kPoolState] = PoolState.ready;
Expand Down
4 changes: 2 additions & 2 deletions src/cmap/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export class PoolClosedError extends MongoDriverError {
* @category Error
*/
export class PoolClearedError extends MongoNetworkError {
// TODO: needs to extend RetryableError or be marked retryable in some other way per spec
// TODO(NODE-3144): needs to extend RetryableError or be marked retryable in some other way per spec
/** The address of the connection pool */
address: string;

constructor(pool: ConnectionPool) {
// TODO: pass in original pool-clearing error and use in message
// TODO(NODE-3135): pass in original pool-clearing error and use in message
// "failed with: <original error which cleared the pool>"
super(`Connection pool for ${pool.address} was cleared because another operation failed`);
this.address = pool.address;
Expand Down

0 comments on commit 27c6327

Please sign in to comment.