From 478f69317bf93f3f97e01ef8a78a13aa1b382d27 Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Thu, 18 Jul 2019 13:02:13 +0300 Subject: [PATCH] Report failures of changing net_ticktime --- src/ejabberd_cluster.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_cluster.erl b/src/ejabberd_cluster.erl index 9cb189248..81c605cde 100644 --- a/src/ejabberd_cluster.erl +++ b/src/ejabberd_cluster.erl @@ -163,7 +163,15 @@ subscribe(Proc) -> %%%=================================================================== set_ticktime() -> Ticktime = ejabberd_option:net_ticktime() div 1000, - net_kernel:set_net_ticktime(Ticktime). + case net_kernel:set_net_ticktime(Ticktime) of + {ongoing_change_to, Time} when Time /= Ticktime -> + ?ERROR_MSG("Failed to set new net_ticktime because " + "the net kernel is busy changing it to the " + "previously configured value. Please wait for " + "~B seconds and retry", [Time]); + _ -> + ok + end. %%%=================================================================== %%% gen_server API