[PATCH] diagnose object write failure with FS back-end

Jim Meyering jim at meyering.net
Mon Dec 5 20:12:51 UTC 2011


There was at least one path to the cryptic
"producer replicas failed (1 of 1)" diagnostic that did not
diagnose the underlying failure.  Makes it hard to diagnose.
This should help:

>From 77cfadd223ff253af8d613f96b433f5052bdaf4a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Mon, 5 Dec 2011 21:11:00 +0100
Subject: [PATCH] diagnose object write failure with FS back-end

* backend.c (fs_put_child): Diagnose failure to open.
Otherwise, this sort of failure would provoke a cryptic diagnostic:
: after sleep (total 1 done 0 error 1)
: producer replicas failed (1 of 1)
Reported by Scott Seago.
---
 backend.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/backend.c b/backend.c
index 936b48c..3d849f5 100644
--- a/backend.c
+++ b/backend.c
@@ -1283,7 +1283,8 @@ fs_put_child (void * ctx)
 	}
 	fd = open(fixed,O_WRONLY|O_CREAT|O_EXCL,0666);
 	if (fd < 0) {
-		pipe_cons_siginit(ps, errno);
+		error (0, errno, _("failed to open file: %s"), fixed);
+		pipe_cons_siginit(ps, -1);
 		free(pp);
 		return THREAD_FAILED;
 	}
--
1.7.8


More information about the iwhd-devel mailing list