-
Notifications
You must be signed in to change notification settings - Fork 646
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
bbolt tests in case of syscalls failures #382
Comments
We can leverage the https://github.com/etcd-io/gofail to intentionally inject some failpoints to mimic some error we want. Let me setup the initial implementation & demo, and then I might breakdown the tasks so that other contributors can jump in to help. |
@ptabor @ahrtr Hi, I am working on this issue. When I use gofail to let munmap return an error, db.close() will return and leave the file locked(because funlock is after munmap), resulting in any future attempts to open the file fails before the process ends. Is this something should be fixed? If the user continuously tries to open the file this might cause a error. I think we may change the order of the cleanups in close, or do not return immediately when encountering an error. |
Yes - sounds like a real issue. |
Another issue encountered: When testing this:
In db.allocate if the file exceeds the original mmap size, it will do a re-map:
However if the munmap succeeds and mmap fails, the db will have its data map set to nil, and any operation will fail afterwards. I think we should make the re-map procedure atomic. Should I start a new issue about this, and fix this issue first and then I can proceed to this one? |
Good catch! Please deliver a PR to fix this issue.
This should be expected. The users should close the db and open it again in such situation. So please fix above issue firstly. |
Thanks @Elbehery. I already added some failpoints, and will double check before I close this ticket. |
I am trying to find something to work on :/ |
@ahrtr Is this finished? What else need to be done? I can help if there is any work to be done. |
We need to add one more failpoint and a test case to simulate lack of disk space, Line 188 in 504e7be
|
Hey @ahrtr I can work on this |
@ahrtr please let me know if there are more failpoints necessary. |
thx for your first contribution to bbolt. I think we can close this ticket. |
We need to grow bbolt tests to cover following scenario:
It's hard to test, it's not performed in qualification and can hit customer's production badly.
It requires some design:
The text was updated successfully, but these errors were encountered: