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

backupds: Improve truncated log handling #5891

Merged
merged 2 commits into from
Apr 2, 2021

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Mar 27, 2021

No description provided.

}

if err := ent.UnmarshalCBOR(bp); err != nil {
switch err {
case io.EOF, io.ErrUnexpectedEOF:
if os.Getenv("LOTUS_ALLOW_TRUNCATED_LOG") == "1" {
panic("handleme; just ignore and tell the caller about the corrupted file") // todo
log.Errorw("log entry potentially truncated")
return false, nil
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter wants you to drop this else now that you have a return

@magik6k magik6k merged commit 0cfc76c into master Apr 2, 2021
@magik6k magik6k deleted the feat/backupds-trunc-log-handling branch April 2, 2021 11:04
@magik6k magik6k mentioned this pull request Apr 13, 2021
69 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants