Skip to content

Commit

Permalink
try finding lock
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Nov 28, 2023
1 parent 692de5f commit cd232df
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/storage/utils/metadata/cs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,22 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse,

md, _ := metadata.FromOutgoingContext(ctx)
httpReq.Header.Add(ctxpkg.TokenHeader, md.Get(ctxpkg.TokenHeader)[0])
fmt.Println("cs3.dataGatewayClient.Do")
log.Info().Str("path", req.Path).Msg("cs3.Upload dataGatewayClient.Do...")
resp, err := cs3.dataGatewayClient.Do(httpReq)
log.Info().Str("path", req.Path).Interface("err", err).Interface("resp", resp).Msg("cs3.Upload dataGatewayClient.Do done")
fmt.Printf("cs3.dataGatewayClient.Do err=%v\n", err)
le := log.Info().Str("path", req.Path).Interface("err", err)
if resp != nil {
le = le.Int("code", resp.StatusCode).Str("status", resp.Status)
}
le.Msg("cs3.Upload dataGatewayClient.Do done")
if err != nil {
log.Info().Str("path", req.Path).Msg("cs3.Upload 0")
return nil, err
}
log.Info().Str("path", req.Path).Msg("cs3.Upload 1")
defer func() {
log.Info().Str("path", req.Path).Msg("cs3.Upload closing body")
resp.Body.Close()
log.Info().Str("path", req.Path).Msg("cs3.Upload closed body")
cerr := resp.Body.Close()
log.Info().Interface("err", cerr).Str("path", req.Path).Msg("cs3.Upload closed body")
}()
log.Info().Str("path", req.Path).Msg("cs3.Upload 2")
if err := errtypes.NewErrtypeFromHTTPStatusCode(resp.StatusCode, httpReq.URL.Path); err != nil {
Expand All @@ -248,7 +250,7 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse,
if ocEtag := resp.Header.Get("OC-ETag"); ocEtag != "" {
etag = ocEtag
}
log.Info().Str("path", req.Path).Err(err).Msg("cs3.Upload returning from cs3.Upload")
log.Info().Str("path", req.Path).Interface("err", err).Msg("cs3.Upload returning from cs3.Upload")
return &UploadResponse{
Etag: etag,
}, nil
Expand Down

0 comments on commit cd232df

Please sign in to comment.