summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteve Powell <steve@rabbitmq.com>2011-11-15 16:23:20 +0000
committerSteve Powell <steve@rabbitmq.com>2011-11-15 16:23:20 +0000
commit115031dee2ddc5d7bb68b6a29d8a352a74fbf68d (patch)
tree4ea652fb71f9a31d8d6f433e43d9482fe4be7a87 /src
parent049db5318f4e73735db41d587e2daffbbab8788a (diff)
parent993c2383db591571f04b056021d94fe162b1071a (diff)
downloadrabbitmq-server-git-115031dee2ddc5d7bb68b6a29d8a352a74fbf68d.tar.gz
Merge default into bug24559
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_guid.erl13
-rw-r--r--src/rabbit_reader.erl2
2 files changed, 9 insertions, 6 deletions
diff --git a/src/rabbit_guid.erl b/src/rabbit_guid.erl
index cf3fea1a53..d92f58a250 100644
--- a/src/rabbit_guid.erl
+++ b/src/rabbit_guid.erl
@@ -76,14 +76,17 @@ guid() ->
%% now() to move ahead of the system time), and b) it is really
%% slow since it takes a global lock and makes a system call.
%%
- %% A persisted serial number, in combination with self/0 (which
- %% includes the node name) uniquely identifies a process in space
+ %% A persisted serial number, the node, and a unique reference
+ %% (per node-incarnation) uniquely identifies a process in space
%% and time. We combine that with a process-local counter to give
%% us a GUID.
+ %%
+ %% We used to use self/0 here instead of the node and unique
+ %% reference. But PIDs wrap.
G = case get(guid) of
- undefined -> {{gen_server:call(?SERVER, serial, infinity), self()},
- 0};
- {S, I} -> {S, I+1}
+ undefined -> Serial = gen_server:call(?SERVER, serial, infinity),
+ {{Serial, node(), make_ref()}, 0};
+ {S, I} -> {S, I+1}
end,
put(guid, G),
erlang:md5(term_to_binary(G)).
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl
index b359f7d452..694abd9e49 100644
--- a/src/rabbit_reader.erl
+++ b/src/rabbit_reader.erl
@@ -281,7 +281,7 @@ handle_other({conserve_memory, Conserve}, Deb, State) ->
handle_other({channel_closing, ChPid}, Deb, State) ->
ok = rabbit_channel:ready_for_close(ChPid),
channel_cleanup(ChPid),
- mainloop(Deb, State);
+ mainloop(Deb, maybe_close(State));
handle_other({'EXIT', Parent, Reason}, _Deb, State = #v1{parent = Parent}) ->
terminate(io_lib:format("broker forced connection closure "
"with reason '~w'", [Reason]), State),