Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Finch supervisor children strartup order #289

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

elfenlaid
Copy link
Contributor

Hello there, the changes aim to resolve the following issue: #277

ArgumentError: unknown registry: Obfuscated.FinchPool
  File "lib/registry.ex", line 1391, in Registry.info!/1
  File "lib/registry.ex", line 1007, in Registry.register/3
  File "lib/finch/http2/pool.ex", line 207, in Finch.HTTP2.Pool.init/1
  File "gen_statem.erl", line 984, in :gen_statem.init_it/6
  File "proc_lib.erl", line 241, in :proc_lib.init_p_do_apply/3

My comment here isn't correct – #277 (comment). The issue happens on shutdowns.


The fix assumes that Supervisors shut down their children in reverse order. The problem with the current order is that DynamicSupervisor children use Registry. The registry goes down sooner than the dynamic supervisor does, causing the unknown registry exception.

I've tried to run the fix on the company servers, and I haven't encountered the unknown registry exception during deploys, at least so far. But maybe I've been lucky 😅

Please let me know what do you think about the changes 🙏

Copy link
Contributor

@wojtekmach wojtekmach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So obvious in hindsight, good catch!

@sneako
Copy link
Owner

sneako commented Sep 4, 2024

Ah of course, thank you! I'll publish to hex asap

@sneako sneako merged commit 8b2ed4f into sneako:main Sep 4, 2024
2 checks passed
@elfenlaid
Copy link
Contributor Author

Thank you all for accepting the fix 🙇

@elfenlaid elfenlaid deleted the fix-children-order branch September 4, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants