From: Pete Zaitcev <zaitcev@redhat.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch 5/7] tabled: suppress repeating messages
Date: Thu, 14 Jan 2010 21:13:40 -0700 [thread overview]
Message-ID: <20100114211340.7644549d@redhat.com> (raw)
Every time CLD crashes, I find my logs filled up with error messages.
But running without them is no good either, so I don't want to remove
this message entirely. Let us try some filtering.
Actually, I am still considering if we should not reset the error
to zero whenever a packet is recived successfuly, but this seems to
work well in practice.
Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
---
server/cldu.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
commit 1c2d867711e4fe62d2ba4dd2f334e0e44a8ff7fa
Author: Master <zaitcev@lembas.zaitcev.lan>
Date: Thu Jan 14 19:57:43 2010 -0700
Filter error messages from UDP receives.
diff --git a/server/cldu.c b/server/cldu.c
index 1d61672..9cda87e 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -53,6 +53,7 @@ struct cld_session {
struct cldc_udp *lib; /* library state */
struct event lib_timer;
int retry_cnt;
+ int last_recv_err;
/*
* For code sanity and being isomorphic with conventional programming
@@ -226,7 +227,16 @@ static void cldu_event(int fd, short events, void *userdata)
rc = cldc_udp_receive_pkt(sp->lib);
if (rc) {
- applog(LOG_INFO, "cldc_udp_receive_pkt failed: %d", rc);
+ if (rc != sp->last_recv_err) {
+ if (rc < -1000) /* our internal code */
+ applog(LOG_INFO,
+ "cldc_udp_receive_pkt failed: %d", rc);
+ else
+ applog(LOG_INFO,
+ "cldc_udp_receive_pkt failed: %s",
+ strerror(-rc));
+ sp->last_recv_err = rc;
+ }
/*
* Reacting to ICMP messages is a bad idea, because
* - it makes us loop hard in case CLD is down, unless we
next reply other threads:[~2010-01-15 4:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 4:13 Pete Zaitcev [this message]
2010-01-20 19:54 ` [Patch 5/7] tabled: suppress repeating messages Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100114211340.7644549d@redhat.com \
--to=zaitcev@redhat.com \
--cc=hail-devel@vger.kernel.org \
--cc=jeff@garzik.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.