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

fix(table): replace unrecoverable panic with error #1951

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

AveralS
Copy link

@AveralS AveralS commented May 17, 2023

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.

@CLAassistant
Copy link

CLAassistant commented May 17, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ AveralS
❌ andresa0425
You have signed the CLA already but the status is still pending? Let us recheck it.

mangalaman93
mangalaman93 previously approved these changes Oct 13, 2023
@mangalaman93
Copy link
Contributor

@AveralS Thanks for the PR. Could you please sign the CLA?

@AveralS
Copy link
Author

AveralS commented Oct 13, 2023

@AveralS Thanks for the PR. Could you please sign the CLA?

No, i dont see accept button here

image

@mangalaman93
Copy link
Contributor

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) {
Copy link
Contributor

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?

@netlify
Copy link

netlify bot commented Oct 13, 2023

Deploy Preview for badger-docs ready!

Name Link
🔨 Latest commit 4225bbe
🔍 Latest deploy log https://app.netlify.com/sites/badger-docs/deploys/65312d4af9080c0008bd9268
😎 Deploy Preview https://deploy-preview-1951--badger-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants