14262: Make sure cancel() from proxy.Do() gets called
[arvados.git] / lib / controller / fed_containers.go
index ccb2401bb78250c36eea03a033370c0f91f0fa47..a3c292583f2df626f2323449f93ff3752d746a3d 100644 (file)
@@ -95,7 +95,10 @@ func remoteContainerRequestCreate(
        req.ContentLength = int64(buf.Len())
        req.Header.Set("Content-Length", fmt.Sprintf("%v", buf.Len()))
 
-       resp, err := h.handler.remoteClusterRequest(*clusterId, req)
+       resp, cancel, err := h.handler.remoteClusterRequest(*clusterId, req)
+       if cancel != nil {
+               defer cancel()
+       }
        h.handler.proxy.ForwardResponse(w, resp, err)
        return true
 }