mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-24 22:45:24 +00:00
fix: add detection for Knex connection pool timeout as transient error
This commit is contained in:
@@ -121,6 +121,7 @@ export function isTransientError(error: any): boolean {
|
||||
'unable to connect',
|
||||
'lost connection',
|
||||
'connection was killed',
|
||||
'timeout acquiring a connection', // Knex connection pool timeout
|
||||
];
|
||||
|
||||
if (specificPatterns.some((pattern) => errorMessage.includes(pattern))) {
|
||||
|
||||
@@ -307,6 +307,14 @@ function isTransientErrorTests() {
|
||||
expect(isTransientError(error)).to.be.true;
|
||||
});
|
||||
|
||||
it('should identify Knex connection pool timeout', () => {
|
||||
const error = {
|
||||
message:
|
||||
'Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?',
|
||||
};
|
||||
expect(isTransientError(error)).to.be.true;
|
||||
});
|
||||
|
||||
it('should identify network partition', () => {
|
||||
const error = {
|
||||
code: 'EHOSTUNREACH',
|
||||
|
||||
Reference in New Issue
Block a user