From cd232df21c5231b5702bc69c3f7d4fe3dad4bb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 28 Nov 2023 12:20:14 +0100 Subject: [PATCH] try finding lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/storage/utils/metadata/cs3.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/storage/utils/metadata/cs3.go b/pkg/storage/utils/metadata/cs3.go index c6e3aa8a406..68795661c00 100644 --- a/pkg/storage/utils/metadata/cs3.go +++ b/pkg/storage/utils/metadata/cs3.go @@ -222,11 +222,13 @@ 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 @@ -234,8 +236,8 @@ func (cs3 *CS3) Upload(ctx context.Context, req UploadRequest) (*UploadResponse, 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 { @@ -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