diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2019-03-13 19:51:09 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2019-03-13 19:51:09 +0300 |
| commit | 3d92284255dd8d21a5d0d2a35f15c93bca0d8f4c (patch) | |
| tree | 1e96477d793ed01b26fbc3fe38f5577d4b0d6b65 /src | |
| parent | cb90500af6a6d15c2f0f2d098be63d4c7137ccbb (diff) | |
| download | rabbitmq-server-git-3d92284255dd8d21a5d0d2a35f15c93bca0d8f4c.tar.gz | |
Start TCP and TLS listeners later in boot process
See #1869 for background.
This makes listener startup and peer notification to be some
of the last boot steps. This way client operations on a node that's
not 100% initialised are less likely.
Since some parts of boot process happen concurrently, without coordinating
all of them with listener startup this is not something that can be
guaranteed. Moving listener startup to a later stage reduces the
probability of clients attempting operations on a booting node.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 20f9b17abf..a6c2359854 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -186,7 +186,7 @@ -rabbit_boot_step({recovery, [{description, "exchange, queue and binding recovery"}, {mfa, {rabbit, recover, []}}, - {requires, [core_initialized]}, + {requires, upgrade_queues}, {enables, routing_ready}]}). -rabbit_boot_step({empty_db_check, @@ -197,43 +197,52 @@ -rabbit_boot_step({routing_ready, [{description, "message delivery logic ready"}, - {requires, core_initialized}]}). + {requires, [core_initialized, recovery]}]}). -rabbit_boot_step({direct_client, [{description, "direct client"}, {mfa, {rabbit_direct, boot, []}}, - {requires, routing_ready}]}). + {requires, routing_ready} + ]}). -rabbit_boot_step({connection_tracking, - [{description, "sets up internal storage for node-local connections"}, + [{description, "connection tracking infrastructure"}, {mfa, {rabbit_connection_tracking, boot, []}}, - {requires, routing_ready}]}). - --rabbit_boot_step({networking, - [{mfa, {rabbit_networking, boot, []}}, - {requires, routing_ready}]}). - --rabbit_boot_step({notify_cluster, - [{description, "notify cluster nodes"}, - {mfa, {rabbit_node_monitor, notify_node_up, []}}, - {requires, networking}]}). + {enables, routing_ready}]}). -rabbit_boot_step({background_gc, [{description, "background garbage collection"}, {mfa, {rabbit_sup, start_restartable_child, [background_gc]}}, - {enables, networking}]}). + {requires, [core_initialized, recovery]}, + {enables, routing_ready}]}). -rabbit_boot_step({rabbit_core_metrics_gc, [{description, "background core metrics garbage collection"}, {mfa, {rabbit_sup, start_restartable_child, [rabbit_core_metrics_gc]}}, - {enables, networking}]}). + {requires, [core_initialized, recovery]}, + {enables, routing_ready}]}). -rabbit_boot_step({rabbit_looking_glass, [{description, "Looking Glass tracer and profiler"}, {mfa, {rabbit_looking_glass, boot, []}}, - {requires, networking}]}). + {requires, [core_initialized, recovery]}, + {enables, routing_ready}]}). + +-rabbit_boot_step({pre_flight, + [{description, "ready to communicate with peers and clients"}, + {requires, [core_initialized, recovery, routing_ready]}]}). + +-rabbit_boot_step({notify_cluster, + [{description, "notifies cluster peers of our presence"}, + {mfa, {rabbit_node_monitor, notify_node_up, []}}, + {requires, pre_flight}]}). + +-rabbit_boot_step({networking, + [{description, "TCP and TLS listeners"}, + {mfa, {rabbit_networking, boot, []}}, + {requires, notify_cluster}]}). %%--------------------------------------------------------------------------- |
