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 database corruption in case of unexpected conditions #1

Merged
merged 2 commits into from Jul 19, 2014

Conversation

scymtym
Copy link
Contributor

@scymtym scymtym commented Jul 18, 2014

In SBCL, evaluations resulting in type-errors or no-applicable-method-errors could result in database corruption because some slots of the conditions (:expected-type and :generic-function respectively) were printed unreadably, making subsequent loading of the database impossible.

The short-term solution, as implemented in the first commit, is adding the slots to stringified-error-prop?.

The second commit adds a "safety net", ensuring that values are actually printable readably.

Not sure what the correct solution is, but this is the fix I used.

inaimathi added a commit that referenced this pull request Jul 19, 2014
Fix database corruption in case of unexpected conditions
@inaimathi inaimathi merged commit 01a92c9 into inaimathi:master Jul 19, 2014
@inaimathi
Copy link
Owner

Looks good as a short term fix.

The real solution for this is a tough call. It might ultimately be switching fact-base from (format s "~s~%" ...) and (read s) to something like a new back-end for cl-store. The default one has two problems with its output: it's binary, and it isn't trivially appendable. Maybe the first one of those doesn't matter too much, but two specific things we want to be able to do with data entries is

  1. append new ones to the end of an existing data file, without re-writing the entire file
  2. read existing entries from the end of an existing file

I'll give it more thought, but I'm open to suggestions.

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