Skip to content

Conversation

@terry-xiaoyu
Copy link
Member

No description provided.

@terry-xiaoyu terry-xiaoyu requested a review from zmstone November 26, 2024 12:38
@terry-xiaoyu terry-xiaoyu force-pushed the handle-stop-pool-timeout branch from bdfff99 to 6293cdf Compare November 26, 2024 12:57
@terry-xiaoyu terry-xiaoyu changed the title Handle stop pool timeout Support timeout for stopping pools Nov 26, 2024
Comment on lines 135 to 147
case process_info(Pid, [dictionary, status, current_function]) of
[{dictionary, Dicts}, {status, Status}, {current_function, CurrFunc}] ->
case proplists:get_value('$initial_call', Dicts) of
{supervisor, ecpool_pool_sup, _} ->
case {Status, CurrFunc} of
{waiting, {proc_lib, _, _}} ->
{ok, Pid};
_ ->
{error, not_stuck_in_start}
end;
_ ->
search_ecpool_pool_sup_process(Rest)
end;
Copy link
Member

Choose a reason for hiding this comment

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

this is too error-prone, can we force the potential processes to be killed with a special key in processes dictionary ?
e.g. put('$ecpool_force_kill', true).

and with a OTP_RELEASE compile switch, we can use process label for the same purpose.
https://www.erlang.org/doc/apps/stdlib/proc_lib.html#set_label/1

Copy link
Member Author

Choose a reason for hiding this comment

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

Here I want to only kill the ecpool_pool_sup processes stuck in its init() callbacks.
In this case it should be calling proc_lib:sync_start/2 (OTP 26+) or proc_lib:sync_start_link/2 (OTP 24), so I'd like to match {current_function, [{proc_lib, _, _}]} here.

@terry-xiaoyu terry-xiaoyu requested a review from zmstone November 26, 2024 16:58
@terry-xiaoyu terry-xiaoyu marked this pull request as draft November 27, 2024 02:31
@terry-xiaoyu terry-xiaoyu force-pushed the handle-stop-pool-timeout branch from 5530c1d to 7fec061 Compare November 27, 2024 06:58
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