Skip to content

Commit 78c1169

Browse files
dumbbellmergify[bot]
authored andcommitted
rabbitmq-run.mk: Start nodes in parallel in start-{brokers,cluster}
[Why] For Mnesia, we don't really care. However, for the upcoming use of Khepri, we need that because the cluster will require at least a quorum number of nodes to start to become available. [How] We simply rely on the shell's job management and wait for them to complete. We do the same for `stop-{brokers,cluster}` mostly for consistency's sake. It also makes starting nodes slightly faster. (cherry picked from commit 414f950)
1 parent a3190d3 commit 78c1169

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

deps/rabbit_common/mk/rabbitmq-run.mk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,11 @@ start-brokers start-cluster: $(DIST_TARGET)
386386
-rabbitmq_web_stomp_examples listener [{port,$$((61633 + $$n - 1))}] \
387387
-rabbitmq_prometheus tcp_config [{port,$$((15692 + $$n - 1))}] \
388388
-rabbitmq_stream tcp_listeners [$$((5552 + $$n - 1))] \
389-
"; \
389+
" & \
390+
done; \
391+
wait && \
392+
for n in $$(seq $(NODES)); do \
393+
nodename="rabbit-$$n@$(HOSTNAME)"; \
390394
if test '$@' = 'start-cluster' && test "$$nodename1"; then \
391395
ERL_LIBS="$(DIST_ERL_LIBS)" \
392396
$(RABBITMQCTL) -n "$$nodename" stop_app; \
@@ -403,8 +407,9 @@ stop-brokers stop-cluster:
403407
@for n in $$(seq $(NODES) -1 1); do \
404408
nodename="rabbit-$$n@$(HOSTNAME)"; \
405409
$(MAKE) stop-node \
406-
RABBITMQ_NODENAME="$$nodename"; \
407-
done
410+
RABBITMQ_NODENAME="$$nodename" & \
411+
done; \
412+
wait
408413

409414
# --------------------------------------------------------------------
410415
# Used by testsuites.

0 commit comments

Comments
 (0)