bitwalker / libcluster

Automatic cluster formation/healing for Elixir applications
MIT License
1.97k stars 188 forks source link

Use handle_continue to avoid blocking during startup #116

Closed frekw closed 3 years ago

frekw commented 4 years ago

Hi!

We've been seeing some issues where libcluster sometimes delays the start of our application (causing automated healthchecks from Kubernetes to fail) which throws us into a restart-loop.

This moves the initialization from init to the new handle_continue callback introduced in OTP21.

seivan commented 4 years ago

The correct approach to this isn't to remove the block which might actually be necessary for a few services, but to use the correct kubernetes probes. If you're having issues with the health probes, maybe look into ready and startup probes. The latter one is more fitting.