Peripli / service-manager

Service Manager Core
Apache License 2.0
69 stars 28 forks source link

Set db connection read and write timeout #539

Closed nirbenrey closed 4 years ago

nirbenrey commented 4 years ago

Pull Request Template

Motivation

In case the database goes down, or the network dies, the open connections will hang.

Approach

We set a timeout for reading and writing on the database connection. Since this functionality is not supported by lib/pq we use https://github.com/Kount/pq-timeouts library as suggested in https://github.com/lib/pq/issues/450

Pull Request status

Third-party code

https://github.com/Kount/pq-timeouts

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.09%) to 86.706% when pulling e016848184a518e583c9db31e58aae0384be6602 on nir--set-on-db-connection-read-and-write-timeouts into 2823f5c993dc10fe8188e47fc0691b26631a6739 on master.