diff options
author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2022-08-04 16:05:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-04 16:05:05 +0200 |
commit | d573fdadc9c77a9bde5a6e4626d9165ff77063c5 (patch) | |
tree | 06fb3078bdd48dd7a6f16669828a6ccee5a7a7ee | |
parent | 93a7c6db794be15fe522dad269ed5d24e9334cf3 (diff) | |
parent | 2a1f27d02cec868be20717c30e9b328751d49113 (diff) | |
download | rabbitmq-server-git-d573fdadc9c77a9bde5a6e4626d9165ff77063c5.tar.gz |
Merge pull request #5438 from rabbitmq/global-sync
Prevent global:sync/0 from being stuck when hostname resolution is not available early on boot
-rw-r--r-- | deps/rabbit/src/rabbit_ff_controller.erl | 2 | ||||
-rw-r--r-- | deps/rabbit/src/rabbit_node_monitor.erl | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/deps/rabbit/src/rabbit_ff_controller.erl b/deps/rabbit/src/rabbit_ff_controller.erl index f8dd874dc6..7b005c5db7 100644 --- a/deps/rabbit/src/rabbit_ff_controller.erl +++ b/deps/rabbit/src/rabbit_ff_controller.erl @@ -268,7 +268,7 @@ register_globally() -> "Feature flags: [global sync] @ ~s", [node()], #{domain => ?RMQLOG_DOMAIN_FEAT_FLAGS}), - ok = global:sync(), + ok = rabbit_node_monitor:global_sync(), ?LOG_DEBUG( "Feature flags: [global register] @ ~s", [node()], diff --git a/deps/rabbit/src/rabbit_node_monitor.erl b/deps/rabbit/src/rabbit_node_monitor.erl index 291bae00ad..447dde637f 100644 --- a/deps/rabbit/src/rabbit_node_monitor.erl +++ b/deps/rabbit/src/rabbit_node_monitor.erl @@ -276,13 +276,13 @@ pause_if_all_down_guard(PreferredNodes, LastNodes, LastState) -> %% state, causing global:sync/0 to never return. %% %% 1. A process is spawned. -%% 2. If after 15", global:sync() didn't return, the "global" +%% 2. If after 10", global:sync() didn't return, the "global" %% state is parsed. %% 3. If it detects that a sync is blocked for more than 10", %% the process sends fake nodedown/nodeup events to the two %% nodes involved (one local, one remote). %% 4. Both "global" instances restart their synchronisation. -%% 5. globao:sync() finally returns. +%% 5. global:sync() finally returns. %% %% FIXME: Remove this workaround, once we got rid of the change to %% "dist_auto_connect" and fixed the bugs uncovered. @@ -297,13 +297,13 @@ workaround_global_hang() -> receive global_sync_done -> ok - after 10000 -> + after 10_000 -> find_blocked_global_peers() end. find_blocked_global_peers() -> Snapshot1 = snapshot_global_dict(), - timer:sleep(10000), + timer:sleep(10_000), Snapshot2 = snapshot_global_dict(), find_blocked_global_peers1(Snapshot2, Snapshot1). @@ -324,8 +324,8 @@ find_blocked_global_peers1([], _) -> unblock_global_peer(PeerNode) -> ThisNode = node(), PeerState = rpc:call(PeerNode, sys, get_status, [global_name_server]), - logger:info( - "Global hang workaround: global state on ~s seems broken~n" + logger:debug( + "Global hang workaround: global state on ~s seems inconsistent~n" " * Peer global state: ~p~n" " * Local global state: ~p~n" "Faking nodedown/nodeup between ~s and ~s", |