Page MenuHomePhabricator

Ensure that timeout errors are caught and logged
Closed, DeclinedPublic

Description

Per error seen in T355246: Respond to 17.01.2024 data import failure, this exception was not caught and logged properly, it does not appear in Logstash events: https://logstash.wikimedia.org/app/discover#/?_g=h@75c69a9&_a=h@a61f24f

/srv/service/node_modules/mariadb/lib/misc/errors.js:64
  return new SqlError(msg, sql, fatal, info, sqlState, errno, additionalStack, addHeader);
         ^

SqlError: (conn=-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after 10011ms
    (pool connections: active=0 idle=0 limit=10)
    at Object.module.exports.createError (/srv/service/node_modules/mariadb/lib/misc/errors.js:64:10)
    at Pool._requestTimeoutHandler (/srv/service/node_modules/mariadb/lib/pool.js:349:26)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7) {
  sqlMessage: 'retrieve connection from pool timeout after 10011ms\n' +
    '    (pool connections: active=0 idle=0 limit=10)',
  sql: null,
  fatal: false,
  errno: 45028,
  sqlState: 'HY000',
  code: 'ER_GET_CONNECTION_TIMEOUT'

We should make sure that we're catching timeout errors, and log them properly.

Event Timeline