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

Initialise the root snapshot's DecRef errs with Close() #1349

Merged
merged 2 commits into from Mar 17, 2020
Merged

Conversation

sreekanth-cb
Copy link
Contributor

During the scorch's Close call, the root snapshot's
DecRef return errs are ignored. Fixing that to bubble up
the errors so that the higher levels may listen and
act on it.

During the scorch's Close call, the root snapshot's
DecRef return errs were ignored. Fixing that to bubble up
the errors so that the higher levels may listen and
act on it.
@coveralls
Copy link

coveralls commented Mar 16, 2020

Coverage Status

Coverage increased (+0.02%) to 67.313% when pulling 1b6b979 on close_err into 2f21902 on master.

Copy link
Contributor

@steveyen steveyen left a comment

Choose a reason for hiding this comment

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

Hi -- I'm thinking using the "err2" pattern here might be better, in that this current proposal is blowing away the err from the s.rootBolt.Close()?

And, in another situation if err was non-nil from the Close(), then this proposal might inadvertently set the err to nil during a successful DecRef()?

@@ -263,7 +263,7 @@ func (s *Scorch) Close() (err error) {
err = s.rootBolt.Close()
Copy link
Member

Choose a reason for hiding this comment

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

This err gets overwritten. Is that ok? Should we just return here if this err isn't nil perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i didn't see the above initialisation.. oops..

@sreekanth-cb sreekanth-cb merged commit f9a23fb into master Mar 17, 2020
@sreekanth-cb sreekanth-cb deleted the close_err branch March 17, 2020 14:23
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.

None yet

4 participants