[ARVADOS] updated: 1f91e02c279bc1e7c47d88da43b72c6882b0ad77

git at public.curoverse.com git at public.curoverse.com
Wed Nov 26 00:55:09 EST 2014


Summary of changes:
 services/keepproxy/keepproxy.go | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

       via  1f91e02c279bc1e7c47d88da43b72c6882b0ad77 (commit)
      from  4faccebcdd7872eca76b183951a2850518d35916 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1f91e02c279bc1e7c47d88da43b72c6882b0ad77
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Nov 23 23:28:34 2014 -0500

    3781: Fix error propagation.

diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index e547efd..503642d 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -391,7 +391,7 @@ func (this PutBlockHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reques
 
 	// Now try to put the block through
 	var replicas int
-	var err error
+	var put_err error
 	if hash == "" {
 		if bytes, err := ioutil.ReadAll(req.Body); err != nil {
 			msg := fmt.Sprintf("Error reading request body: %s", err)
@@ -399,16 +399,16 @@ func (this PutBlockHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reques
 			http.Error(resp, msg, http.StatusInternalServerError)
 			return
 		} else {
-			hash, replicas, err = kc.PutB(bytes)
+			hash, replicas, put_err = kc.PutB(bytes)
 		}
 	} else {
-		hash, replicas, err = kc.PutHR(hash, req.Body, contentLength)
+		hash, replicas, put_err = kc.PutHR(hash, req.Body, contentLength)
 	}
 
 	// Tell the client how many successful PUTs we accomplished
 	resp.Header().Set(keepclient.X_Keep_Replicas_Stored, fmt.Sprintf("%d", replicas))
 
-	switch err {
+	switch put_err {
 	case nil:
 		// Default will return http.StatusOK
 		log.Printf("%s: %s %s finished, stored %v replicas (desired %v)", GetRemoteAddress(req), req.Method, hash, replicas, kc.Want_replicas)
@@ -432,15 +432,15 @@ func (this PutBlockHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reques
 				log.Printf("%s: wrote %v bytes to response body and got error %v", n, err2.Error())
 			}
 		} else {
-			http.Error(resp, "", http.StatusServiceUnavailable)
+			http.Error(resp, put_err.Error(), http.StatusServiceUnavailable)
 		}
 
 	default:
-		http.Error(resp, err.Error(), http.StatusBadGateway)
+		http.Error(resp, put_err.Error(), http.StatusBadGateway)
 	}
 
-	if err != nil {
-		log.Printf("%s: %s %s stored %v replicas (desired %v) got error %v", GetRemoteAddress(req), req.Method, hash, replicas, kc.Want_replicas, err.Error())
+	if put_err != nil {
+		log.Printf("%s: %s %s stored %v replicas (desired %v) got error %v", GetRemoteAddress(req), req.Method, hash, replicas, kc.Want_replicas, put_err.Error())
 	}
 
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list