Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging of failed chunks transfer #59

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func copyFunc(con net.Conn, instanceCnf *config.Instance, args []string) error {

ansType, body, err := protoReader.ReadPacket()
if err != nil {
ylogger.Zero.Debug().Err(err).Msg("error while ans")
ylogger.Zero.Debug().Err(err).Msg("error while answer")
return err
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/proc/interaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,13 @@ func ProcConn(s storage.StorageInteractor, cr crypt.Crypter, ycl client.YproxyCl
}

if _, err := io.Copy(writerToNewBucket, fromReader); err != nil {
ylogger.Zero.Error().Err(err).Msg("failed to copy data")
ylogger.Zero.Error().Str("path", path).Err(err).Msg("failed to copy data")
failed = append(failed, objectMetas[i])
return
}

if err := writerToNewBucket.Close(); err != nil {
ylogger.Zero.Error().Err(err).Msg("failed to close writer")
ylogger.Zero.Error().Str("path", path).Err(err).Msg("failed to close writer")
failed = append(failed, objectMetas[i])
return
}
Expand All @@ -371,7 +371,7 @@ func ProcConn(s storage.StorageInteractor, cr crypt.Crypter, ycl client.YproxyCl
ylogger.Zero.Error().Any("failed files", objectMetas).Msg("failed to upload some files")

_ = ycl.ReplyError(err, "failed to copy some files")
return nil
return err
}

if _, err = ycl.GetRW().Write(message.NewReadyForQueryMessage().Encode()); err != nil {
Expand Down
Loading