Uploaded image for project: 'MariaDB Connector/node.js'
  1. MariaDB Connector/node.js
  2. CONJS-312

pool error message improvement when failing to create connection

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 3.4.1
    • pool
    • None

    Description

      Initial issue : https://github.com/mariadb-corporation/mariadb-connector-nodejs/issues/305
      problem is that pool error are not explicit.
      The problem is that when not retrieving any connection, the initial cause is not always indicated.

      Goal for the example from initial issue is having a clear error message, like :

      SqlError: (conn:-1, no: 45028, SQLState: HY000) pool timeout: failed to retrieve a connection from pool after 205ms
          (pool connections: active=0 idle=0 limit=1)
          at module.exports.createError (C:\projects\mariadb-connector-nodejs\lib\misc\errors.js:65:21)
          at Pool._rejectTimedOutRequest (C:\projects\mariadb-connector-nodejs\lib\pool.js:326:33)
          at Pool._checkRequestTimeouts (C:\projects\mariadb-connector-nodejs\lib\pool.js:294:14)
          at listOnTimeout (node:internal/timers:581:17)
          at process.processTimers (node:internal/timers:519:7) {
        sqlMessage: 'pool timeout: failed to retrieve a connection from pool after 205ms\n' +
          '    (pool connections: active=0 idle=0 limit=1)',
        sql: null,
        fatal: false,
        errno: 45028,
        sqlState: 'HY000',
        code: 'ER_GET_CONNECTION_TIMEOUT',
        [cause]: SqlError: (conn:-1, no: 45012, SQLState: 08S01) Connection timeout: failed to create socket after 1ms
            at module.exports.createFatalError (C:\projects\mariadb-connector-nodejs\lib\misc\errors.js:90:10)
            at Connection.connectTimeoutReached (C:\projects\mariadb-connector-nodejs\lib\connection.js:1099:24)
            at listOnTimeout (node:internal/timers:583:11)
            at process.processTimers (node:internal/timers:519:7)
         From event:
            at C:\projects\mariadb-connector-nodejs\lib\connection.js:142:13
            at new Promise (<anonymous>)
            at Connection.connect (C:\projects\mariadb-connector-nodejs\lib\connection.js:131:12)
            at Pool._createPoolConnection (C:\projects\mariadb-connector-nodejs\lib\pool.js:144:8)
            at Timeout._onTimeout (C:\projects\mariadb-connector-nodejs\lib\pool.js:278:18)
            at listOnTimeout (node:internal/timers:581:17)
            at process.processTimers (node:internal/timers:519:7) {
          sqlMessage: 'Connection timeout: failed to create socket after 1ms',
          sql: null,
          fatal: true,
          errno: 45012,
          sqlState: '08S01',
          code: 'ER_CONNECTION_TIMEOUT'
        }
      }
      

      The error cause is explicit

      Attachments

        Activity

          There are no comments yet on this issue.

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.