Connection terminated due to connection timeout error
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- azure, javascript, kubernetes, node.js, postgresql
- Ambito
- backend, cloud, databases, networking
Direzione di ricerca
Inizia esaminando la configurazione segnalata di TypeORM, pg, Azure Database for PostgreSQL e AKS, quindi confronta il comportamento tra gli SKU Standard_B4ms e Standard_D4as_v5. Analizza lo stack trace del timeout della connessione e la possibile differenza di Azure Accelerated Networking. Il lavoro è completato quando sono state identificate una causa riproducibile e una correzione verificata della configurazione o della dipendenza.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We are using NestJS with TypeORM v0.3.25 and pg v8.11.3
Our TypeOrm config is:
const baseOrmConfig: PostgresConnectionOptions & TypeOrmModuleOptions = {
type: 'postgres',
host: process.env.DATABASE_HOST ?? 'localhost',
port: process.env.DATABASE_PORT !== undefined ? Number(process.env.DATABASE_PORT) : 5432,
username: process.env.DATABASE_USERNAME ?? 'postgres',
password: process.env.DATABASE_PASSWORD ?? 'password',
synchronize: false,
logging: ['error'],
autoLoadEntities: true,
ssl: process.env.DATABASE_HOST !== undefined,
extra: {
// setting this to 0 to disable auto-disconnect cspell: disable-next-line
idleTimeoutMillis: 60_000,
keepAlive: true,
keepAliveInitialDelayMillis: 60_000,
max: 10,
connectionTimeoutMillis: 30_000, // number of milliseconds to wait for connection
},
};
We host this service on a Azure Kubernetes Service cluster, and are making connections to an Azure Database for PostgreSQL Flexible Server.
Recently, we upgraded our AKS Node SKUs from Standard_B4ms to Standard_D4as_v5, and started seeing a lot of the foll. error:
Error: Connection terminated due to connection timeout
at Client.<anonymous> (/usr/src/app/node_modules/pg-pool/index.js:251:17)
at Client.patchedClientConnectCallback (/usr/src/app/node_modules/@opentelemetry/instrumentation-pg/build/src/utils.js:309:12)
at /usr/src/app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:50:55
at AsyncLocalStorage.run (node:internal/async_local_storage/async_hooks:91:14)
at SentryContextManager.with (/usr/src/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)
at SentryContextManager.with (/usr/src/app/node_modules/@sentry/opentelemetry/build/cjs/index.js:1430:24)
at Client.contextWrapper [as _connectionCallback] (/usr/src/app/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:50:32)
at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:145:18)
at Object.onceWrapper (node:events:632:28)
at Connection.emit (node:events:518:28) { [cause]: Error: Connection terminated unexpectedly
at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73)
at Object.onceWrapper (node:events:632:28)
at Connection.emit (node:events:518:28)
at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:63:12)
at Socket.emit (node:events:518:28)
at TCP.<anonymous> (node:net:346:12)
at TCP.callbackTrampoline (node:internal/async_hooks:130:17) }
We reverted to using the Standard_B4ms SKU and the errors stopped. However, we do need to upgrade our SKUs. We did not have this error on our setup before this.
Any ideas what could be causing this error, and how we could fix this? The only possible explanation we could have found was that it could be related to Azure Accelerated Networking, but have no proof.
- Lingua principale
- JavaScript
- Stelle
- 13.2k
- Fork
- 1.4k
- Merge medio
- 6g 15h
- PR unite (30g)
- 6
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di brianc/node-postgres
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brianc/node-postgres#3770 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
brianc/node-postgres#3716 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brianc/node-postgres#3631 · 1 commento ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 62/100
brianc/node-postgres#2857 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
brianc/node-postgres#2433 ·
Tutte le issue di brianc/node-postgres
Issue simili
-
Update HugeIcons library Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
antfu-collective/icones#398 ·
-
ECmail.com Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
wesbos/burner-email-providers#554 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
radiantearth/stac-browser#1023 ·
-
HMR stops working Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
components-web-app/docs#92 ·