Closed kernwig closed 2 years ago
Can I submit an PR to just add 'EPIPE'
to tooManyConnsErrors
? @jeremydaly
Per here, may want to include 'ECONNRESET'
as well. Most bug reports about EPIPE are people trying very large queries, so maybe that's why you didn't include it. (That scenario would fail every time.) But it also can happen when the connection is dropped by the server - due to idle or restart.
Yes, please submit a PR.
Very good. I'm testing the change in my app right now - so I'll make the PR after it proves out.
PR submitted. I had an console.log
on the retry when testing this so that I could see it work.
START RequestId: e3360cc5-0dd6-45b5-a764-92f5351eeb1c Version: 92
2020-02-28T17:45:45.803Z e3360cc5-0dd6-45b5-a764-92f5351eeb1c INFO do query...
2020-02-28T17:45:46.100Z e3360cc5-0dd6-45b5-a764-92f5351eeb1c INFO Resetting DB client due to err: EPIPE
2020-02-28T17:45:46.320Z e3360cc5-0dd6-45b5-a764-92f5351eeb1c INFO DB: Opened a new connection
END RequestId: e3360cc5-0dd6-45b5-a764-92f5351eeb1c
REPORT RequestId: e3360cc5-0dd6-45b5-a764-92f5351eeb1c Duration: 543.96 ms Billed Duration: 600 ms Memory Size: 256 MB Max Memory Used: 106 MB
PR #71 is waiting for some loving attention, @jeremydaly .
Hey, @jeremydaly are you willing to accept a PR for the ECONNRESET
case?
Of course!
@jeremydaly Opened https://github.com/jeremydaly/serverless-mysql/pull/123
I'm periodically receiving this exception in my Nodejs 10 Lambdas under light load. It always happens after the Lambda has been idle for around ten minutes. A later run in the same instance obtains a new connection and everything is fine once again.
Obviously I can catch and retry this on my own, but I expected dropped connections to be normal behavior handled by this library, since it is actively killing connections. Should I be pursuing a serverless-mysql library fix or handling it in my code?
Here's one entire CloudWatch log for an instance (just removing a little bit of noise via):