Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

When exiting the monitoring thread, shut off data collection.

And if the monitoring thread is shut off, don't collect any data in the queue.
  • Loading branch information...
commit a61f4642ed29bc727d2361a4000500b81573ea11 1 parent d1a5be1
Christopher Browne authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/slon/monitor_thread.c
View
5 src/slon/monitor_thread.c
@@ -89,6 +89,7 @@ monitorThread_main(void *dummy)
dstring_data(&monquery), PQresultErrorMessage(res));
PQclear(res);
dstring_free(&monquery);
+ monitor_threads = false;
slon_log(SLON_ERROR, "monitorThread: exit monitoring thread\n");
pthread_exit(NULL);
return (void *) 0;
@@ -219,6 +220,7 @@ monitorThread_main(void *dummy)
slon_disconnectdb(conn);
slon_log(SLON_INFO, "monitorThread: thread done\n");
+ monitor_threads = false;
pthread_exit(NULL);
return (void *) 0;
}
@@ -249,6 +251,9 @@ monitor_state(const char *actor, int node, pid_t conn_pid, /* @null@ */ const ch
char *ns;
pid_t mypid;
+ if (!monitor_threads) /* Don't collect if this thread is shut off */
+ return;
+
mypid = getpid();
pthread_mutex_lock(&stack_lock);
if (mstack == NULL)
Please sign in to comment.
Something went wrong with that request. Please try again.