-
Notifications
You must be signed in to change notification settings - Fork 106
Description
if mysql socket closed (my be the network broken)
when i fetch
finally go to here:
do_recv(LogFun, RecvPid, SeqNum) when is_function(LogFun);
LogFun == undefined,
SeqNum == undefined ->
receive
{mysql_recv, RecvPid, data, Packet, Num} ->
{ok, Packet, Num};
{mysql_recv, RecvPid, closed, _E} ->
{error, io_lib:format("mysql_recv: socket was closed ~p", [_E])}
end;
do_recv(LogFun, RecvPid, SeqNum) when is_function(LogFun);
LogFun == undefined,
is_integer(SeqNum) ->
ResponseNum = SeqNum + 1,
receive
{mysql_recv, RecvPid, data, Packet, ResponseNum} ->
{ok, Packet, ResponseNum};
{mysql_recv, RecvPid, closed, _E} ->
{error, io_lib:format("mysql_recv: socket was closed ~p", [_E])}
end.
this function return {error, Reason}
the mysql_conn process will already alive but the mysql_recv process dead
why we don't close the mysql_conn process here since it no use!!
it not restart no use