manhvu

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

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

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

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

dimitarvp

I honestly have no idea what you just said, sorry man. :smiley:

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
sacepums
Hey guys. I'm new to elixir and im really stocked about it. But I ran into a bit of problem - I need to convert a date sting, for examp...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
Fl4m3Ph03n1x
Background Let’s assume I have a typical GenServer that receives messages as requests, does some operation in a DB and returns responses....
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement