Closed Cantido closed 4 years ago
Hi @Cantido, thanks for the PR!
From what I understand, though, implementing a catch-all handle_info clause is a best practice.
Not necessarily. For example, I often prefer to not implement a catch-all because if it does receive a message that it doesn't expect, then it may be a bug somewhere in the software (i.e. I forgot to receive a message that I should OR someone is sending a message to the wrong place).
For the reason above, I prefer to not merge this one for now. Thanks!
Understood! Thanks for the quick response!
On Jun 17, 2020, at 1:25 PM, José Valim notifications@github.com wrote:
Hi @Cantido https://github.com/Cantido, thanks for the PR!
From what I understand, though, implementing a catch-all handle_info clause is a best practice.
Not necessarily. For example, I often prefer to not implement a catch-all because if it does receive a message that it doesn't expect, then it may be a bug somewhere in the software (i.e. I forgot to receive a message that I should OR someone is sending a message to the wrong place).
For the reason above, I prefer to not merge this one for now. Thanks!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elixir-ecto/db_connection/pull/219#issuecomment-645574827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALPSQYLZKWWFGCC7XOBXPLRXEKDJANCNFSM4OA4NM5Q.
I have a related question, actually. When this process crashes, I'm not seeing it restart. In fact, it seems to take down the entire DB connection and it doesn't reconnect. Queries fail with ** (DBConnection.ConnectionError) tcp recv: closed
. Is this intended?
I need to investigate to be sure. :)
If you could do that, that would be fantastic! Either way, I got some good results from this experiment of mine and my app will be much more tolerant of DB errors.
I super appreciate the work you do. Thank you!
This is a good practice because anything can send our Watcher process a message and crash it. From my own experimentation, the process isn't starting back up, either.
Now, I should say that I do have a process that sends messages to random processes, as part of a chaos engineering effort on my team, so it's up to y'all if this is a practical concern or not. From what I understand, though, implementing a catch-all
handle_info
clause is a best practice.