[sheepdog] [PATCH stable-0.7] sheep: don't print error message when connection is off

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Mar 11 15:55:01 CET 2014


From: Liu Yuan <namei.unix at gmail.com>

...
Dec 17 19:04:27  ERROR [net 11088] do_read(220) connection is closed (48 bytes left)
Dec 17 19:04:27  ERROR [net 11088] rx_work(684) failed to read a header
...

This is quit annoying since nothing wrong with it and sheep.log is flooded with
these messages.

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 lib/net.c       | 2 +-
 sheep/request.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/net.c b/lib/net.c
index e38dfaa..b32e022 100644
--- a/lib/net.c
+++ b/lib/net.c
@@ -217,7 +217,7 @@ int do_read(int sockfd, void *buf, int len, bool (*need_retry)(uint32_t epoch),
 reread:
 	ret = read(sockfd, buf, len);
 	if (ret == 0) {
-		sd_err("connection is closed (%d bytes left)", len);
+		sd_debug("connection is closed (%d bytes left)", len);
 		return 1;
 	}
 	if (ret < 0) {
diff --git a/sheep/request.c b/sheep/request.c
index 39e0d9e..553b133 100644
--- a/sheep/request.c
+++ b/sheep/request.c
@@ -534,7 +534,7 @@ static void rx_work(struct work *work)
 
 	ret = do_read(conn->fd, &hdr, sizeof(hdr), NULL, 0, UINT32_MAX);
 	if (ret) {
-		sd_err("failed to read a header");
+		sd_debug("failed to read a header");
 		conn->dead = true;
 		return;
 	}
-- 
1.8.3.2




More information about the sheepdog mailing list