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
fix(table): replace unrecoverable panic with error #1951
base: main
Are you sure you want to change the base?
Conversation
|
@AveralS Thanks for the PR. Could you please sign the CLA? |
No, i dont see accept button here |
That's pretty odd. You could try a different browser. |
table/table.go
Outdated
@@ -343,14 +343,14 @@ func OpenInMemoryTable(data []byte, id uint64, opt *Options) (*Table, error) { | |||
return t, nil | |||
} | |||
|
|||
func (t *Table) initBiggestAndSmallest() error { | |||
func (t *Table) initBiggestAndSmallest() (err error) { |
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.
Can you remove the named return variable?
✅ Deploy Preview for badger-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Problem
I am using badger to store some temporary transactional data. My database crashed due to power failure and when the app starts again it panics due to the broken badger database. I can't handle this panic, because it is called in a separate goroutine.
Solution
initBiggestAndSmallest method should return an error when recovering from underlying panic.