projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
14738: Enhances code readability when concatenating strings.
[arvados.git]
/
services
/
keepstore
/
proxy_remote.go
diff --git
a/services/keepstore/proxy_remote.go
b/services/keepstore/proxy_remote.go
index 66bfce16e2b4578893419508513d72e836f090d4..1f82f3f4fc79d82c8f1a6fa1586410d94c9d76dc 100644
(file)
--- 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 {
remoteID := part[1:6]
remote, ok := cluster.RemoteClusters[remoteID]
if !ok {
- http.Error(w, "remote cluster not configured", http.StatusBad
Gateway
)
+ http.Error(w, "remote cluster not configured", http.StatusBad
Request
)
return
}
kc, err := rp.remoteClient(remoteID, remote, token)
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])
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
if err == RequestHashError {
http.Error(rrc.ResponseWriter, "checksum mismatch in remote response", http.StatusBadGateway)
return err