fix: handle pool not ready on cron catch_up#24
Open
Taure wants to merge 1 commit into
Open
Conversation
shigoto_cron sends itself a catch_up message immediately on init, but
when shigoto starts as a dependency before the host app creates the
pgo pool, the catch_up handler crashes with noproc. This causes
max_restart_intensity and takes down the whole shigoto supervision tree.
Wrap the pool-accessing calls in safe_with_leader_lock/1 which catches
exit:{noproc, _} and retries after 1 second.
🟠 Code Coverage — 52.5%634 of 1208 lines covered. ✅ ELP LintNo diagnostics. ℹ️ 11 OTP CVEs auto-ignored (already fixed in running version)These CVEs are patched in the installed OTP version but NVD data
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shigoto_croncrashes withnoprocon startup when the pgo pool isn't created yet (host app creates pool in itsstart/2, but shigoto starts first as a dependency)safe_with_leader_lock/1that catchesexit:{noproc, _}and retries after 1 secondmax_restart_intensityfrom taking down the entire shigoto supervision treeTest plan
applicationslist and pgo pool created instart/2— verify no crash