[sheepdog] [PATCH] store: return SD_RES_NETWORK_ERROR when error is retryable

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed May 1 07:44:15 CEST 2013


We have to avoid SD_RES_EIO as far as we can.  When the backend store
returns an retryable error, it should return SD_RES_NETWORK_ERROR for
gateway to try the request again.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/plain_store.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sheep/plain_store.c b/sheep/plain_store.c
index c1db177..b539df1 100644
--- a/sheep/plain_store.c
+++ b/sheep/plain_store.c
@@ -75,6 +75,13 @@ static int err_to_sderr(char *path, uint64_t oid, int err)
 		/* TODO: stop automatic recovery */
 		sd_eprintf("diskfull, oid=%"PRIx64, oid);
 		return SD_RES_NO_SPACE;
+	case EMFILE:
+	case ENFILE:
+	case EINTR:
+	case EAGAIN:
+		sd_eprintf("%m, oid=%"PRIx64, oid);
+		/* make gateway try again */
+		return SD_RES_NETWORK_ERROR;
 	default:
 		sd_eprintf("oid=%"PRIx64", %m", oid);
 		return md_handle_eio(dir);
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list