Open elhigu opened 6 years ago
can you create a gist so I don't need to copy text manually (and see what needs to go to npm install)? Ideally with some start scripts in package.json ? I think it's better tool compared to a bunch of fence code blocks :)
Absolutely true. Will do (tomorrow, now I'll get some sleep) 👍
EDIT: no I didn't, I built some shelves to storage room instead :) trying it again today, because for the rest of the week I don't have any spare time either.
Didit! https://gist.github.com/ddbc399aadbe6d9942f5a2869607af97
npm install
npm run docker:start
npm run test:die
npm run test:hang
npm run docker:stop
@sidorares Did you manage to reproduce it in the end or is some additional assistance still needed?
can't remember, I think first time I tried docker example it worked for me, Can you try it yourself @kibertoad ? Would be great if you can assist
@sidorares Could you please check if this https://github.com/kibertoad/node-mysql2/tree/master/stress-test works for you? Unfortunately I'll only get access to Mac machine in about 10 days, and Docker on Windows is a mess.
@kibertoad I've been using this lately for docker in windows https://github.com/docker/machine it's been working pretty nice :)
I opened new issue, since in this case we are just using single connection and there are no queued commands like in #695.
I'm running my stress test script which breaks connection very often like every 1000 sent bytes and every 2 seconds. After running some seconds or some minutes, script hangs when trying to make query (or during connecting + making query).
Test code / environment are as follows:
mysql2@1.5.2 mysql@2.15.0 node v8.9.0
docker-compose.yml (starts mysql (33306) + toxiproxy (23306))
mysql2-random-hanging-every-now-and-then.js:
Again sorry for the pretty complicated test setup and finding such difficult problem to figure out. I just hope you are able to reproduce theses findings.
I'm going to add these tests to knex repo to be able to verify in future knex versions that all the dialects have robust way to recognize connection state and drop/create connections to pool even in case when connections are lost in middle of protocol.