Skip to content

Commit 115031d

Browse files
author
Steve Powell
committed
Merge default into bug24559
2 parents 049db53 + 993c238 commit 115031d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/rabbit_guid.erl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,17 @@ guid() ->
7676
%% now() to move ahead of the system time), and b) it is really
7777
%% slow since it takes a global lock and makes a system call.
7878
%%
79-
%% A persisted serial number, in combination with self/0 (which
80-
%% includes the node name) uniquely identifies a process in space
79+
%% A persisted serial number, the node, and a unique reference
80+
%% (per node-incarnation) uniquely identifies a process in space
8181
%% and time. We combine that with a process-local counter to give
8282
%% us a GUID.
83+
%%
84+
%% We used to use self/0 here instead of the node and unique
85+
%% reference. But PIDs wrap.
8386
G = case get(guid) of
84-
undefined -> {{gen_server:call(?SERVER, serial, infinity), self()},
85-
0};
86-
{S, I} -> {S, I+1}
87+
undefined -> Serial = gen_server:call(?SERVER, serial, infinity),
88+
{{Serial, node(), make_ref()}, 0};
89+
{S, I} -> {S, I+1}
8790
end,
8891
put(guid, G),
8992
erlang:md5(term_to_binary(G)).

src/rabbit_reader.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ handle_other({conserve_memory, Conserve}, Deb, State) ->
281281
handle_other({channel_closing, ChPid}, Deb, State) ->
282282
ok = rabbit_channel:ready_for_close(ChPid),
283283
channel_cleanup(ChPid),
284-
mainloop(Deb, State);
284+
mainloop(Deb, maybe_close(State));
285285
handle_other({'EXIT', Parent, Reason}, _Deb, State = #v1{parent = Parent}) ->
286286
terminate(io_lib:format("broker forced connection closure "
287287
"with reason '~w'", [Reason]), State),

0 commit comments

Comments
 (0)