From b2bbc4908b67252aac4348acfc15ae4711bcdf01 Mon Sep 17 00:00:00 2001 From: Jan Uhlig Date: Thu, 4 Jul 2024 16:04:29 +0200 Subject: [PATCH] Augment explanation for the local use of erpc:call --- src/ranch.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ranch.erl b/src/ranch.erl index 4e0f09f624..81e63f6ee3 100644 --- a/src/ranch.erl +++ b/src/ranch.erl @@ -193,6 +193,11 @@ start_error(_, Error) -> Error. -spec stop_listener(ref()) -> ok | {error, not_found}. stop_listener(Ref) -> + %% The stop procedure must be executed in a separate + %% process to make sure that it won't be interrupted + %% in the middle in case the calling process crashes. + %% We use erpc:call locally so we don't have to + %% implement a custom spawn/call mechanism. %% We need to provide an integer timeout to erpc:call, %% otherwise the function will be executed in the calling %% process. 5 minutes should be enough.