Closed matthewhanson closed 5 years ago
Update on this, knex is switching from pool2 to generic-pool in 0.12+ in an attempt to fix all of the bad pool state issues https://github.com/tgriesser/knex/pull/1665
This refers to the previous version of osm-stats-workers and is no longer relevant.
The Lambda functions suffer from intermittent errors where it times out trying to connect to the database. This appears to be related to the way that lambda containers are reused and the database connection pooling that is performed through knex.
It seems that this is a known issue with lambda and RDS: https://forums.aws.amazon.com/thread.jspa?messageID=678029
so for now we are looking for a work-around, such as closing the connection after each invocation.
Note thatIf the database timesout, the lambda function is retried with the same data until it succeeds. So while this doesn't lead to any data loss, it can lead to a backlog of data.