streaming logging fixes
Costa Tsaousis (ktsaou) committed
Dec 28, 2017 at 14:01 UTC
7102aa8ed3bb8504a5237cc7cf093c666ef3fcb4
3 files changed
+7
-7
src/backends.c
+2
-2
@@ -508,14 +508,14 @@ static void backends_main_cleanup(void *ptr) {
508
}
509
510
void *backends_main(void *ptr) {
511
+ netdata_thread_cleanup_push(backends_main_cleanup, ptr);
512
+
513
int default_port = 0;
514
int sock = -1;
515
BUFFER *b = buffer_create(1), *response = buffer_create(1);
516
int (*backend_request_formatter)(BUFFER *, const char *, RRDHOST *, const char *, RRDSET *, RRDDIM *, time_t, time_t, uint32_t) = NULL;
517
int (*backend_response_checker)(BUFFER *) = NULL;
518
517
- netdata_thread_cleanup_push(backends_main_cleanup, ptr);
518
-
519
// ------------------------------------------------------------------------
520
// collect configuration options
521
src/rrdpush.c
+4
-4
@@ -935,7 +935,7 @@ int rrdpush_receiver_permission_denied(struct web_client *w) {
935
int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url) {
936
(void)host;
937
938
- info("STREAM [receive from [%s]:%s]: new client connection.", w->client_ip, w->client_port);
938
+ info("clients wants to STREAM metrics.");
939
940
char *key = NULL, *hostname = NULL, *registry_hostname = NULL, *machine_guid = NULL, *os = "unknown", *timezone = "unknown", *tags = NULL;
941
int update_every = default_rrd_update_every;
@@ -1051,13 +1051,13 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url
1051
rpt->update_every = update_every;
1052
netdata_thread_t thread;
1053
1054
- debug(D_SYSTEM, "STREAM [receive from [%s]:%s]: starting receiving thread.", w->client_ip, w->client_port);
1054
+ debug(D_SYSTEM, "starting STREAM receive thread.");
1055
1056
char tag[FILENAME_MAX + 1];
1057
- snprintfz(tag, FILENAME_MAX, "STREAM_RECEIVER[[%s]:%s]", w->client_ip, w->client_port);
1057
+ snprintfz(tag, FILENAME_MAX, "STREAM_RECEIVER[%s,[%s]:%s]", rpt->hostname, w->client_ip, w->client_port);
1058
1059
if(netdata_thread_create(&thread, tag, NETDATA_THREAD_OPTION_DEFAULT, rrdpush_receiver_thread, (void *)rpt))
1060
- error("STREAM [receive from [%s]:%s]: failed to create new thread for client.", w->client_ip, w->client_port);
1060
+ error("Failed to create new STREAM receive thread for client.");
1061
1062
// prevent the caller from closing the streaming socket
1063
if(w->ifd == w->ofd)
src/threads.h
+1
-1
@@ -16,7 +16,7 @@ typedef enum {
16
17
typedef pthread_t netdata_thread_t;
18
19
-#define NETDATA_THREAD_TAG_MAX 50
19
+#define NETDATA_THREAD_TAG_MAX 100
20
extern const char *netdata_thread_tag(void);
21
22
extern size_t netdata_threads_init(void);