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
Badger shouldn't just panic when open a bad database #1797
Comments
Use Discuss Issues for reporting issues about this repository. |
@skrdgraph it's the issue, much appreciated if you can help |
@HaoboGu will do our best. For the time being, I'm tagging @pandeyshubham25 (he may have come across this) ... |
thanks very much! |
@HaoboGu would you be able to provide us with sample steps to reproduce this issue? some other qs:
|
|
i'll try this later in the day, and circle back. pls bear with me as I figure this out (will be discussing with the internal team on this ...) |
no problem :D |
ok this may not be very helpful, tested this on Mac-OS 12.4 (won't have access to windows machine till tomorrow) Looks like I get a different error while trying to do this:
Are you trying to open the DB like this? |
I got this:
|
your error is probably related to folder permissions -> my error is something I need to look further into. @MichelDiz have you see this before? @HaoboGu - how did you exactly simulate the error you have indicated in your original post #1797 (comment)? You did respond saying
if you could elaborate on the steps it will be helpful. |
I would suggest in function newLevelsController of levels.go, add a defer function to recover and panic again in the go routine (line 129), so that the panic in this go routine can be caught by the client code. |
When BadgerDB tries to open a corrupted dababase, sometime it would just panic(seems that this panic only occurs on Windows):
As a widely used dependency, BadgerDB should not just panic. Those panics cannot be captured and then breaks the whole application.
The text was updated successfully, but these errors were encountered: