mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
366 stars 91 forks source link

Disconnect event not caught #195

Closed Galienna closed 2 years ago

Galienna commented 2 years ago

Hi,

The 3.0.0 release seems to have introduced a bug that wasn't there in 2.5.6.

Scenario

Exact same code and scenario works fine with 2.5.6

Good luck and thank you for the lib :)

rusher commented 2 years ago

i'm trying to reproduced the problem without success. Do you have any additional information ? could you confirm that those event are set with poll 'connection' event, then connection 'error' event ? something like :

pool.on('connection', conn => {
      conn.on('error', (err) => {
        console.log(`connection ${conn.threadId} error `);
        console.log(err);
      })
    });
rusher commented 2 years ago

corrected with https://jira.mariadb.org/browse/CONJS-196. Will be part of 3.0.1 release