Is it safe to unlink from gen_fsm on the fly?

Sergey Samokhin prikrutil@REDACTED
Mon Sep 21 19:42:44 CEST 2009


I'm trying to make my wrapper around epgsql more tolerant of network
outages. When my gen_server detects that connection has been lost, a
special process is created to make a connection in an asynchronous
manner (I want to handle calls to the server, so I can't block in
reconnect function). When connection is established, pid is sent back
to the gen_server and 'connector' process is unlinked from the pid.

Are there any pitfalls of unlinking from working gen_fsm? Does gen_fsm
store parent id anywhere into the state?

I haven't found using of the parent process's id in the epgsql sources.

P.S. I see another way to implement smoothly reconnects without
blocking gen_server: by using erlang:start_timer/3 in the gen_server.
I haven't decided yet which way is better =)


Sergey Samokhin

More information about the erlang-questions mailing list