Fix a few more "still reachable". End all redis unused threads.

pull/1026/head
Stefan Mititelu 5 years ago
parent 11bcdf60f5
commit eb8169868d

@ -39,7 +39,11 @@ void set_graphite_interval_tv(struct timeval *tv) {
}
void set_prefix(char* prefix) {
graphite_prefix = prefix;
graphite_prefix = g_strdup(prefix);
}
void free_prefix(void) {
g_free(graphite_prefix);
}
static struct requests_ps clear_requests_per_second(struct requests_ps *requests) {

@ -960,6 +960,8 @@ int main(int argc, char **argv) {
ilog(LOG_INFO, "Version %s shutting down", RTPENGINE_VERSION);
recording_fs_free();
unfill_initial_rtpe_cfg(&initial_rtpe_config);
call_free();
@ -977,6 +979,8 @@ int main(int argc, char **argv) {
redis_close(rtpe_redis_write);
redis_close(rtpe_redis_notify);
free_prefix();
options_free();
log_free();

@ -113,6 +113,18 @@ static const struct pcap_format *pcap_format;
/**
* Free RTP Engine filesystem settings and structure.
* Check for and free the RTP Engine spool directory.
*/
void recording_fs_free(void) {
if (spooldir)
free(spooldir);
spooldir = NULL;
}
/**
* Initialize RTP Engine filesystem settings and structure.
* Check for or create the RTP Engine spool directory.

@ -1768,6 +1768,9 @@ int redis_restore(struct redis *r) {
g_thread_pool_push(gtp, call, NULL);
}
g_thread_pool_stop_unused_threads();
g_thread_pool_set_max_unused_threads(0);
g_thread_pool_free(gtp, FALSE, TRUE);
while ((r = g_queue_pop_head(&ctx.r_q)))
redis_close(r);

@ -19,6 +19,7 @@ enum connection_state {
extern struct timeval rtpe_latest_graphite_interval_start;
void set_prefix(char* prefix);
void free_prefix(void);
void graphite_loop(void *d);
void set_latest_graphite_interval_start(struct timeval *tv);
void set_graphite_interval_tv(struct timeval *tv);

@ -101,6 +101,7 @@ extern const struct recording_method *selected_recording_method;
* Check for or create the RTP Engine spool directory.
*/
void recording_fs_init(const char *spooldir, const char *method, const char *format);
void recording_fs_free(void);
/**

@ -194,6 +194,7 @@ static void options(int *argc, char ***argv) {
//the daemon has no function
die("Both output and forwarding are disabled");
}
g_free(output_format);
output_format = NULL;
} else if (!output_mixed && !output_single)
output_mixed = output_single = 1;
@ -250,7 +251,12 @@ int main(int argc, char **argv) {
wait_threads_finish();
if (decoding_enabled)
codeclib_free();
options_free();
log_free();
cleanup();
}

Loading…
Cancel
Save