Hi, I got a dropped db connection error: “RubyError: ActiveRecord::StatementInvalid: Mysql2::Error::ConnectionError: MySQL server has gone away”
It happened only once so far, so fairly rare, but all Lambdas were affected and it required a redeploy to fix. I still don’t know why (after redeploy everything was fine). I’ve read in the guides about the shared Lambda context but I’m not familiar enough with it. Any suggestions? Eg, is it worth setting “reconnect: true” in the db config (database.yml)? Any other recommended settings for a production deploy?
I don’t think the issue was too many connections because the number stayes pretty consistent around 15 connections, spiking to 25 max.
Using: mysql2 (0.5.2), activerecord (6.0.0), jets (2.3.4), with an RDS Mysql 5.7.22