stackhero-io / node-red-contrib-stackhero-mysql

Node-RED node to read and write to a MySQL or a MariaDB database. Compatible with TLS (SSL) and "Caching SHA2 password" authentication method.
16 stars 7 forks source link

Reopen - Connections are stacking #7

Closed geekgarage closed 3 years ago

geekgarage commented 3 years ago

I've created a video going through my whole setup and showing what is what, explaining how I've set it up. Since you couldn't reproduce it using mariadb i've set it all up from scratch using only docker containers and switched to MySQL with the same result. I'm also showing my flows and such so you can analyze if I'm doing something stupid and causing this. but from my math it's stacking every single SQL connection in my subflow for each subflow every time i deplay. i have used the subflow 3 times throughout my main flows, with 7 sql connections inside the subflow (total 21) and it is stacking 21 every sing time i deploy. If you want i'm up for testing and even do teamviewer if you want so you can go into detail with it. If interested catch me at discord.geekgarage.dk

But here is the video of the whole debacle https://youtu.be/-Kmls2mIX80 (ready in HD)

EDIT: After the video i also did a fresh container in docker of nodered, and it's the same issue. EDIT2: I've tried taking it out of subflow and into the main flow, without any change. Also Updating to 1.0.4 has not change to the issue EDIT3: Process List https://i.imgur.com/QPdntib.png and https://i.imgur.com/MkvVgb9.png https://stackoverflow.com/questions/2407732/mysql-proccesslist-filled-with-sleep-entries-leading-to-too-many-connections

So in conclusion, they don't disconnect from what my limited coding knowledge tells me. So i'm back at the node issue

EDIT4: Another thing i noticed in the above process list. I changed 'SET session wait_timeout=20;' and then had a look in the list again. the connections are kept in sleep state but they reset the counter every 20 second.

Originally posted by @geekgarage in https://github.com/stackhero-io/node-red-contrib-stackhero-mysql/issues/5#issuecomment-766742997

Bacto commented 3 years ago

Closed. See #5