Ericsson / ered

An Erlang client library for Valkey/Redis Cluster
MIT License
11 stars 6 forks source link

Fault tolerance #39

Closed zuiderkwast closed 4 months ago

zuiderkwast commented 4 months ago

This change adds a supervisor for client processes, so a client process can crash without affecting the other client processes or the ered instance. (An ered client may crash e.g. due to a bug in OTP's TLS implementation.)

To keep track of missing or dead client processes, the ered process manages monitors to all ered_client processes, so it can properly return errors to commands handled by a crashed client process. ered:command/3,4 returns a value in all situations. ered:command_async/4 does not always return a value though. Specifically, if the client process crashes while handling the command, the reply callback function will never be called.

Fixes #1.

zuiderkwast commented 4 months ago

No noticeable performance impact I guess?

Not that I noticed. We don't have benchmarks...