r-lmr / lmrdashboard

Dashboard project for #linuxmasterrace IRC displaying real-time information
https://dash.linuxmasterrace.org
GNU General Public License v3.0
2 stars 0 forks source link

backend crashes with "KnexTimeoutError: Knex: Timeout acquiring a connection." #117

Open maxaudron opened 3 years ago

maxaudron commented 3 years ago

runtime has been 38days, there might be some connection pool running full with time or so.

[debug] 2021-05-21 17:55:32: IrcMessageProcessor.ts: Parsing new IRC message
[info]  2021-05-21 17:55:32: IrcMessageProcessor.ts: New message: :Eldbogi!Eldbogi@snoonet.org/user/Eldbogi QUIT :Connection closed
[debug] 2021-05-21 17:55:32: ircconnection.ts: Parsed IRC message: {"ircMessage":{"prefix":"Eldbogi!Eldbogi@snoonet.org/user/Eldbogi","command":"QUIT","params":["Connection closed"]}}

/lmrdashboard/backend/node_modules/knex/lib/client.js:348
        convertedError = new KnexTimeoutError(
                         ^
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_MySQL.acquireConnection (/lmrdashboard/backend/node_modules/knex/lib/client.js:348:26)
    at runMicrotasks (<anonymous>)
    at runNextTicks (node:internal/process/task_queues:58:5)
    at listOnTimeout (node:internal/timers:524:9)
    at processTimers (node:internal/timers:498:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
LoLei commented 3 years ago

I increased the pool limit (https://github.com/r-lmr/lmrdashboard/commit/c44c5a64e908ca26f8b045466f8fcda9c40a8645) and timeout (https://github.com/r-lmr/lmrdashboard/commit/cc180664f0a456e00f2fc3a0fc0f82a09289bb8b) as a quickfix, if that doesn't help we may look into using transactions as those are mentioned a few times in related threads (https://github.com/knex/knex/issues/2820). The version upgrade of pg would not help in our case I assume since we're using mysql.