Accessing tileo.co or tileo-beta.co after some time of inactivity raises 500 status code responses due to broken database connection, even if conn_validator_timeout is set to something reasonable (120 seconds). The kind of errors you can see at Rollbar contain the following message:
PG::Error: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Steps to Reproduce
Wait some time without nobody using the platform, and access any page.
Current Result
500 HTTP response.
Expected result
Page shown.
Additional info
I have almost discarded that the problem is due bad configuration of Sequel connection validator.
After some investigation my feeling is that it is related with docker swarm. Probably some kind of network problem in that mode. Some of the following could be generating the problem:
Context
Accessing tileo.co or tileo-beta.co after some time of inactivity raises 500 status code responses due to broken database connection, even if
conn_validator_timeout
is set to something reasonable (120 seconds). The kind of errors you can see at Rollbar contain the following message:PG::Error: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Steps to Reproduce
Wait some time without nobody using the platform, and access any page.
Current Result
500 HTTP response.
Expected result
Page shown.
Additional info
I have almost discarded that the problem is due bad configuration of Sequel connection validator.
After some investigation my feeling is that it is related with docker swarm. Probably some kind of network problem in that mode. Some of the following could be generating the problem: