I’m using ecto 3.10.3, ecto_sql 3.10.1 and postgrex0.17.2 on a rather simple service. For reason beyond my control my Postgres DB faces some small downtimes every now and then. This trigger alerts that are annoying for my team.
I wanted to make my service more resilient to those downtimes. Specifically, I wanted to have my service trying to reconnect to the DB for a couple of minutes before crashing/logging errors.
I’ve found that postgresx has some configuration options like backoff_type and max_restarts, which I think could help me. However, I see that on ecto_sql those seem to be forced to be backoff_type: :stop and max_restarts: 0.
Is there any other way I can make my system more resilient to small DB downtimes?
Can you provide the error message? And the scenario of that messages? Given what you said I’m assuming it is actually breaking your app and on app restart it doesn’t apply the backoff strategy.