node-red/node-red-nodes

mysql: Old instance fires off errors like `"Error: Pool is closed."`

Steve-Mcl opened this issue · 1 comments

Which node are you reporting an issue on?

node-red-node-mysql

What are the steps to reproduce?

  1. add a mySQL node and configure the config node to non existent DB (e.g. IP: 10.20.30.40)
  2. wait until timeout errors are pushed from the config node into debug pane
  3. edit the config node and set its scope from global to the flow the mysql flow node resides on
  4. deploy and wait for more errors from the config

What happens?

  • The deploy takes a long time and you see [error] [MySQLdatabase:config_name] Error stopping node: Close timed out in the runtime log
  • The old instance fires off errors like "Error: Pool is closed." (unexpected)
  • The new instance fires off errors like "Error: connect ETIMEDOUT 10.20.30.40:3306" (expected)

What do you expect to happen?

Old instance to be properly closed/destroyed and no longer firing messages

Please tell us about your environment:

  • Node-RED version: V3 beta 4 (probably same on 2.x but harder to spot since the debug pane doesnt have the new popover to identify hierarchy)
  • node.js version: 16
  • npm version: NA
  • Platform/OS: windows 11
  • Browser: NA

Tidied up closing when not connected in the first place -
5515582523045365
version 1.0.2 on npm