This should be a simple question, but I don't know my way around the documentation well enough to find the answer.
If an OTP supervisor restarts a gen_server after it has crashed, does the new child process inherit the crashed process's message queue, or are messages sent before the crash but not yet processed by the old child dropped on the floor?
No, a process never inherits any state set by a previous process. A supervisor will only restart the process with the same arguments used to start it in the first place.
If you want to recover state, you should make sure that such state is saved in a persistent manner (ETS tables, file on disk, database etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With