Skip to content
Snippets Groups Projects
Commit 502af93b authored by Domokos Sármány's avatar Domokos Sármány
Browse files

Terminate telemetry listener once all all client apps have left

Note that this is fine for the ECMWF case but not in general because
it is perfectly leagitimate for all applications to leave and then
later some others to join.
parent c205299f
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ char *g_conf_pminfo = NULL;
/** logging destination */
int g_conf_logdst = LOGDST_STDOUT;
/** verbose operation */
bool g_verbose = true;
bool g_verbose = false;
/** usage */
......@@ -353,6 +353,8 @@ event_loop(void)
MSTRO_SUBSCRIPTION_OPTS_DEFAULT,
&join_leave_subscription);
uint32_t joinCount=0;
uint32_t leaveCount=0;
bool done = false;
mstro_nanosec_t starttime = mstro_clock();
......@@ -378,6 +380,7 @@ event_loop(void)
switch(tmp->kind) {
case MSTRO_POOL_EVENT_APP_JOIN:
++joinCount;
if(g_verbose)
fprintf(stdout, "Noticed JOIN event of app %s\n",
tmp->join.component_name);
......@@ -392,6 +395,7 @@ event_loop(void)
break;
case MSTRO_POOL_EVENT_APP_LEAVE:
++leaveCount;
if(g_verbose) {
fprintf(stdout, "Noticed LEAVE event of app %" PRIappid "\n",
tmp->leave.appid);
......@@ -456,6 +460,10 @@ event_loop(void)
}
}
if((0 < leaveCount) && (joinCount == leaveCount)) {
  • Maintainer

    it would be great to make a command line option to enable/disable this behavior.

  • Please register or sign in to reply
done=true;
}
if(mstro_clock()>starttime+DEFAULT_MAX_WAIT) {
fprintf(stderr, "Waited %" PRIu64 "s and still not done\n",
DEFAULT_MAX_WAIT/(1000*1000*1000));
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment