[erlang-questions] terminate() not finishing after application:stop()

Ulf Wiger (TN/EAB) <>
Tue Jun 10 15:45:51 CEST 2008


Make sure your process is trapping exits.
If it isn't, the process will die immediately when
the supervisor calls exit(Pid, shutdown).

BR,
Ulf W

Gijsbert de Haan skrev:
> Hi,
> 
> I have an application that I want to stop. In terminate() of one of the
> processes I save some state to an xml file (with xmerl:export() and
> file:write_file()). When this process terminates by itself all is well,
> and the file is saved.
> But when I call application:stop(myapp) the call to xmerl:export() (in
> terminate) never returns and the state is not saved. There are no error
> reports in the log, just the usual info report about myapp having
> exited. I have put a try/catch (throw/exit/error) around the
> xmerl:export() with some io:format() calls but nothing comes out.
> 
> Anybody have a suggestion?
> Thanks,
> Gijsbert
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list