[asterisk-commits] taskprocessor.c: Increase CLI "core ping taskprocessor" time... (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 20 14:18:45 CST 2016


Mark Michelson has submitted this change and it was merged.

Change subject: taskprocessor.c: Increase CLI "core ping taskprocessor" timeout.
......................................................................


taskprocessor.c: Increase CLI "core ping taskprocessor" timeout.

Change-Id: I4892d6acbb580d6c207d006341eaf5e0f8f2a029
---
M main/taskprocessor.c
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index 8e4381d..1ba0c8a 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -395,9 +395,18 @@
 		return CLI_SUCCESS;
 	}
 	ast_cli(a->fd, "\npinging %s ...", name);
-	when = ast_tvadd((begin = ast_tvnow()), ast_samp2tv(1000, 1000));
+
+	/*
+	 * Wait up to 5 seconds for a ping reply.
+	 *
+	 * On a very busy system it could take awhile to get a
+	 * ping response from some taskprocessors.
+	 */
+	begin = ast_tvnow();
+	when = ast_tvadd(begin, ast_samp2tv(5000, 1000));
 	ts.tv_sec = when.tv_sec;
 	ts.tv_nsec = when.tv_usec * 1000;
+
 	ast_mutex_lock(&cli_ping_cond_lock);
 	if (ast_taskprocessor_push(tps, tps_ping_handler, 0) < 0) {
 		ast_mutex_unlock(&cli_ping_cond_lock);
@@ -407,6 +416,7 @@
 	}
 	ast_cond_timedwait(&cli_ping_cond, &cli_ping_cond_lock, &ts);
 	ast_mutex_unlock(&cli_ping_cond_lock);
+
 	end = ast_tvnow();
 	delta = ast_tvsub(end, begin);
 	ast_cli(a->fd, "\n\t%24s ping time: %.1ld.%.6ld sec\n\n", name, (long)delta.tv_sec, (long int)delta.tv_usec);

-- 
To view, visit https://gerrit.asterisk.org/2048
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4892d6acbb580d6c207d006341eaf5e0f8f2a029
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list