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

Handle exceptions when flushing WAL #3283

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Handle exceptions when flushing WAL #3283

merged 1 commit into from
Apr 16, 2024

Conversation

benjaminwinger
Copy link
Collaborator

Unhandled exceptions in the Database destructor can't be easily handled in the rust API, and even in the C++ API it may cause terminate to be called, which is not very user-friendly and will bypass other error reporting mechanisms.

I'm not entirely sure why this is only occurring in the one rust test on windows.
Perhaps fsync doesn't produce an error if run on a file opened read-only, while FlushFileBuffers does, explaining why it only happens on Windows, but there is a similar test for the C API: CAPIDatabaseTest.CreationReadOnly, which doesn't have the same problem. But at the least, this will fix CI and make the issue easier to debug and we can open an issue for the rest.

I also removed some unnecessary code from a different rust test which had been producing warnings.

Unhandled exceptions in the Database destructor can't be easily handled in the
rust API, and even in the C++ API it may cause terminate to be called, which is not very
user-friendly and will bypass other error reporting mechanisms.
Copy link
Contributor

@ray6080 ray6080 left a comment

Choose a reason for hiding this comment

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

Thanks! @benjaminwinger

@ray6080 ray6080 merged commit 014c17a into master Apr 16, 2024
17 checks passed
@ray6080 ray6080 deleted the wal-flush-fix branch April 16, 2024 02:29
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

2 participants