-
Notifications
You must be signed in to change notification settings - Fork 138
fix(table): close writers on error for every exit path #667
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
Conversation
ea38d98 to
7dbc458
Compare
| if err != nil { | ||
| return nil, err | ||
| } | ||
| defer internal.CheckedClose(wr, &err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't cause an error when we successfully call close at line 300?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 1124 to 1126 in 9e4a5b7
| if w.closed { | |
| return nil | |
| } |
no because it's no-op, Close() sets closed field to true (first defer) and when it's true (second defer), it returns early
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good then. Is there anything else needed before you shift this out of Draft?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed for the pattern if there were more and found a few more cases. Fixed and added a regression test, should be good to go now. Marking ready
zeroshade
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one nitpick question but otherwise looks good!
7dbc458 to
c466baa
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
c466baa to
66a09f7
Compare
kevinjqliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I double checked for all usage of NewManifestWriter and ManifestListWriter
related to #644