Skip to content

Commit 3f6ef2a

Browse files
committed
fix(jdbc-driver): Log errors from connection pool factory
generic-pool will just silently throw those away, so we should at least log them
1 parent ab8ad2b commit 3f6ef2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/cubejs-jdbc-driver/src/JDBCDriver.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ export class JDBCDriver extends BaseDriver {
183183
acquireTimeoutMillis: 120000,
184184
...(poolOptions || {})
185185
}) as ExtendedPool;
186+
187+
// https://github.com/coopernurse/node-pool/blob/ee5db9ddb54ce3a142fde3500116b393d4f2f755/README.md#L220-L226
188+
this.pool.on('factoryCreateError', (err) => {
189+
this.databasePoolError(err);
190+
});
191+
this.pool.on('factoryDestroyError', (err) => {
192+
this.databasePoolError(err);
193+
});
186194
}
187195

188196
protected async getCustomClassPath() {

0 commit comments

Comments
 (0)