Skip to content

Commit 7c4cf55

Browse files
committed
Merge pull request #2172 from petermm/fix-timer-manager-reports
Fix: benign gen_server start race crash reports Fixes #1001 These changes are made under both the "Apache 2.0" and the "GNU Lesser General Public License 2.1 or later" license terms (dual license). SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
2 parents 6d771f3 + 97da9c7 commit 7c4cf55

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

libs/estdlib/src/gen_server.erl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,22 +125,22 @@ init_it(Starter, Name, Module, Args, Options) ->
125125
init_it(Starter, Module, Args, Options)
126126
catch
127127
error:badarg:S ->
128-
ErrorT =
129-
case whereis(Name) of
130-
undefined ->
131-
badarg;
132-
Pid when is_pid(Pid) ->
133-
{already_started, Pid}
134-
end,
135-
crash_report(
136-
io_lib:format("gen_server:init_it/5: Error initializing module ~p under name ~p", [
137-
Module, Name
138-
]),
139-
Starter,
140-
ErrorT,
141-
S
142-
),
143-
proc_lib:init_ack(Starter, {error, ErrorT})
128+
case whereis(Name) of
129+
undefined ->
130+
crash_report(
131+
io_lib:format(
132+
"gen_server:init_it/5: Error initializing module ~p under name ~p", [
133+
Module, Name
134+
]
135+
),
136+
Starter,
137+
badarg,
138+
S
139+
),
140+
proc_lib:init_ack(Starter, {error, badarg});
141+
Pid when is_pid(Pid) ->
142+
proc_lib:init_ack(Starter, {error, {already_started, Pid}})
143+
end
144144
end.
145145

146146
init_it(Starter, Module, Args, Options) ->

0 commit comments

Comments
 (0)