X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/13fc31b65d1fa7e737d0e3ce345b3d556d14af16..163c8f8750193b791eb62f5a8d73dc44a006b69e:/services/keepstore/proxy_remote.go diff --git a/services/keepstore/proxy_remote.go b/services/keepstore/proxy_remote.go index 66bfce16e2..1f82f3f4fc 100644 --- a/services/keepstore/proxy_remote.go +++ b/services/keepstore/proxy_remote.go @@ -66,7 +66,7 @@ func (rp *remoteProxy) Get(ctx context.Context, w http.ResponseWriter, r *http.R remoteID := part[1:6] remote, ok := cluster.RemoteClusters[remoteID] if !ok { - http.Error(w, "remote cluster not configured", http.StatusBadGateway) + http.Error(w, "remote cluster not configured", http.StatusBadRequest) return } kc, err := rp.remoteClient(remoteID, remote, token) @@ -174,6 +174,11 @@ func (rrc *remoteResponseCacher) Close() error { return nil } _, err := PutBlock(rrc.Context, rrc.Buffer, rrc.Locator[:32]) + if rrc.Context.Err() != nil { + // If caller hung up, log that instead of subsequent/misleading errors. + http.Error(rrc.ResponseWriter, rrc.Context.Err().Error(), http.StatusGatewayTimeout) + return err + } if err == RequestHashError { http.Error(rrc.ResponseWriter, "checksum mismatch in remote response", http.StatusBadGateway) return err