So I have this application that has a process that requires some gen_servers to be alive somewhere else in the cluster.
If they are up it just works, if they are not, my gen_server fails in init with {error,Reason}
, this propagates through my supervisor into my applications start
function.
The problem is that if I return anything other than {ok,Pid} I get a crash report.
我在这里的意图是以某种方式表明,应用程序无法正常启动,所有进程都处于下行状态,而且由于应用程序不应被视为活动状态,然而,我只能选择返回 {ok, self()} 并看到我的应用程序在不返回或返回 {error, oil} 时以 active
列出,看看它是如何崩溃的:
{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[rtb_sup,<0.134.0>]},
{messages,[]},{links,[<0.135.0>]},{dictionary,[]},{trap_exit,false},{status,running},
{heap_size,377},{stack_size,24},{reductions,255}],[]]:
"
问题似乎比这个大, 基本上无法告诉应用程序框架该应用程序失败。 它可能看起来像由 < code> 处理的这些事情之一, 由 < code> 程序在 erlan 中死 < / code >, 但允许在 < code> 应用程序上使用 < code> {/ code> 返回值 : start code > 似乎是一种良好的权衡 。
有暗示吗?