diff options
author | Matthias Radestock <matthias@lshift.net> | 2010-04-30 16:03:35 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2010-04-30 16:03:35 +0100 |
commit | bd02893a09a27f00d8b362bdefc58729322d9ea0 (patch) | |
tree | 3a774189da84ef0b8744ac6dc22c291e60a007f3 /src/tcp_acceptor.erl | |
parent | bd1f34d8cc55e3a4c09392bddec160116627f315 (diff) | |
download | rabbitmq-server-bd02893a09a27f00d8b362bdefc58729322d9ea0.tar.gz |
cherry-pick file_handle_cache from bug21673
and its integration with the tcp_acceptor and worker_pool code
Diffstat (limited to 'src/tcp_acceptor.erl')
-rw-r--r-- | src/tcp_acceptor.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tcp_acceptor.erl b/src/tcp_acceptor.erl index 68efc27f..3b23daa5 100644 --- a/src/tcp_acceptor.erl +++ b/src/tcp_acceptor.erl @@ -76,7 +76,7 @@ handle_info({inet_async, LSock, Ref, {ok, Sock}}, [inet_parse:ntoa(Address), Port, inet_parse:ntoa(PeerAddress), PeerPort]), %% handle - apply(M, F, A ++ [Sock]) + file_handle_cache:release_on_death(apply(M, F, A ++ [Sock])) catch {inet_error, Reason} -> gen_tcp:close(Sock), error_logger:error_msg("unable to accept TCP connection: ~p~n", @@ -104,6 +104,7 @@ code_change(_OldVsn, State, _Extra) -> inet_op(F) -> rabbit_misc:throw_on_error(inet_error, F). accept(State = #state{sock=LSock}) -> + ok = file_handle_cache:obtain(), case prim_inet:async_accept(LSock, -1) of {ok, Ref} -> {noreply, State#state{ref=Ref}}; Error -> {stop, {cannot_accept, Error}, State} |