profile
viewpoint

Ask questionsshutdown ENOTCONN on TLS.Socket._final

  • Version: v10.15.1
  • Platform: node:10.15.1 docker image on 64bit linux

When using v10.15.1 we are seeing processes exiting with:

Error: shutdown ENOTCONN
  File "net.js", line 364, col 25, in TLSSocket.Socket._final
  File "_stream_writable.js", line 612, col 10, in callFinal
  File "internal/process/next_tick.js", line 63, col 19, in process._tickCallback

This appears in services connecting to Amazon RDS instances via TLS. We are using https://registry.npmjs.org/mysql/-/mysql-2.15.0.tgz and https://registry.npmjs.org/knex/-/knex-0.14.4.tgz for connection pooling.

We do not see these errors on earlier node image (I have tested v10.15.0, v10.14.2 and v10.0.0).

Could this be impacted by #24290 and related commits?
The errors could possibly be bettered handled higher up (by knex or the mysql client), but this does seem to be a significant change in behaviour.

nodejs/node

Answer questions syrnick

We're running into the same issue. I don't have a fully runnable repro that I can share, but it reproduces when the connection is closed while the query is still in flight. It looks roughly like this:

const connection = mysql.createConnection(...);
await connection.connect();
connection.query('SOME QUERY', []); // Important: missing await
await util.setTimeoutAsync(100 * Math.random()); // wait a bit; not sure if this is necessary.
connection.end();

There is just mysql@2.16.0, no pooling.

useful!
source:https://uonfu.com/
Github User Rank List