Przeglądaj źródła

When host/port process dies, ets table is not cleaned up, which breaks all subsequent connections to this host/port.

pull/120/head
Dmitriy Ivolgin 10 lat temu
rodzic
commit
2b38b4528b
1 zmienionych plików z 4 dodań i 1 usunięć
  1. +4
    -1
      src/ibrowse_lb.erl

+ 4
- 1
src/ibrowse_lb.erl Wyświetl plik

@ -216,7 +216,10 @@ handle_info(_Info, State) ->
%% Description: Shutdown the server
%% Returns: any (ignored by gen_server)
%%--------------------------------------------------------------------
terminate(_Reason, _State) ->
terminate(_Reason, #state{host = Host, port = Port}) ->
% Use delete_object instead of delete in case another process for this host/port
% has been spawned, in which case will be deleting the wrong record because pid won't match.
ets:delete_object(ibrowse_lb, #lb_pid{host_port = {Host, Port}, pid = self()}),
ok.
%%--------------------------------------------------------------------

Ładowanie…
Anuluj
Zapisz