Skip to content

Commit 1070cbc

Browse files
author
Ken Gaillot
authored
Make some logs less noisy (#495)
* log: lower IPC connection issues to info level ... in handle_new_connection(). The caller has better context for whether a problem merits a warning or error, and the function's return code is sufficiently descriptive to do so. Some problems may be expected or able to be worked around. For example, Pacemaker's crm_mon attempts to contact pacemakerd IPC. On a Pacemaker Remote node, that IPC will be unavailable, and crm_mon can check the libqb return code to detect and handle that situation gracefully. * log: lower some ringbuffer debug messages to trace level They're rather noisy, with every shm-based IPC connection generating multiple obscure messages like: debug: shm size:1048589; real_size:1052672; rb->word_size:263168 and every disconnect generating the rather unhelpful: debug: qb_ipcc_disconnect() along with multiple messages like: debug: Closing ringbuffer: /dev/shm/qb-10986-11014-34-26VRvs/qb-request-cmap-header All of these seem appropriate to trace level.
1 parent c752813 commit 1070cbc

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

lib/ipc_setup.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010,2013 Red Hat, Inc.
2+
* Copyright 2010-2024 Red Hat, Inc.
33
*
44
* Author: Angus Salkeld <[email protected]>
55
*
@@ -765,16 +765,15 @@ handle_new_connection(struct qb_ipcs_service *s,
765765
qb_ipcs_connection_unref(c);
766766
} else {
767767
if (res == -EACCES) {
768-
qb_util_log(LOG_ERR, "Invalid IPC credentials (%s).",
768+
qb_util_log(LOG_INFO, "IPC connection credentials rejected (%s)",
769769
c->description);
770770
} else if (res == -EAGAIN) {
771-
qb_util_log(LOG_WARNING, "Denied connection, is not ready (%s)",
771+
qb_util_log(LOG_INFO, "IPC connection not ready (%s)",
772772
c->description);
773773
} else {
774-
errno = -res;
775-
qb_util_perror(LOG_ERR,
776-
"Error in connection setup (%s)",
774+
qb_util_perror(LOG_INFO, "IPC connection setup failed (%s)",
777775
c->description);
776+
errno = -res;
778777
}
779778

780779
if (c->state == QB_IPCS_CONNECTION_INACTIVE) {

lib/ipcc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010 Red Hat, Inc.
2+
* Copyright 2010-2024 Red Hat, Inc.
33
*
44
* Author: Angus Salkeld <[email protected]>
55
*
@@ -480,7 +480,7 @@ qb_ipcc_disconnect(struct qb_ipcc_connection *c)
480480
{
481481
struct qb_ipc_one_way *ow = NULL;
482482

483-
qb_util_log(LOG_DEBUG, "%s()", __func__);
483+
qb_util_log(LOG_TRACE, "%s(%s)", __func__, (c == NULL)? "NULL" : "");
484484

485485
if (c == NULL) {
486486
return;

lib/ringbuffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2010-2011 Red Hat, Inc.
2+
* Copyright 2010-2024 Red Hat, Inc.
33
*
44
* Author: Angus Salkeld <[email protected]>
55
*
@@ -233,7 +233,7 @@ qb_rb_open_2(const char *name, size_t size, uint32_t flags,
233233
goto cleanup_hdr;
234234
}
235235

236-
qb_util_log(LOG_DEBUG,
236+
qb_util_log(LOG_TRACE,
237237
"shm size:%ld; real_size:%ld; rb->word_size:%d", size,
238238
real_size, rb->shared_hdr->word_size);
239239

lib/ringbuffer_helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,12 @@ qb_rb_close_helper(struct qb_ringbuffer_s * rb, int32_t unlink_it,
334334
char *hdr_path = rb->shared_hdr->hdr_path;
335335

336336
if (unlink_it) {
337-
qb_util_log(LOG_DEBUG, "Free'ing ringbuffer: %s", hdr_path);
337+
qb_util_log(LOG_TRACE, "Free'ing ringbuffer: %s", hdr_path);
338338
if (rb->notifier.destroy_fn) {
339339
(void)rb->notifier.destroy_fn(rb->notifier.instance);
340340
}
341341
} else {
342-
qb_util_log(LOG_DEBUG, "Closing ringbuffer: %s", hdr_path);
342+
qb_util_log(LOG_TRACE, "Closing ringbuffer: %s", hdr_path);
343343
hdr_path = NULL;
344344
}
345345

0 commit comments

Comments
 (0)