manhvu
Process is hangover (stuck) when call DynamicSupervisor.start_child/2 from children of the DynamicSupervisor
My case:
Application starts a DynamicSupervisor and a GenServer for adding children to DynamicSupervisor.
GenServer make children when received tasks from outside.
Each child after made by GenServer will make other children from inside process in parallel.
My issue: Children process will be hangover when calling DynamicSupervisor.start_child/2. Any one know about this issue?
Marked As Solved
manhvu
From question of @TamLyNhat I think my code was deadlock.
For detail:
Children call again start_child/2 in init function while the supervisor is still waiting result from init (call from last `start_child/2’).
I will test again to verify this case.
Also Liked
al2o3cr
This sounds like exactly the sort of thing that :continue and handle_continue are designed to prevent - moving the start_child call from init to handle_continue should prevent the deadlock.
TamLyNhat
Hi,
As I remembered, I have experienced a case when GenServer does not send the response reply to the caller, and this process still calls some other functions, and sends the handle_call/handle_cast message to this GenServer, it jumps into loop infinity because this process of GenServer sends the message to itself which does not release yet.
Seem likes you are facing a similar case I encountered before.
dimitarvp
I honestly have no idea what you just said, sorry man. ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









