-
Notifications
You must be signed in to change notification settings - Fork 594
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
Add BackgroundWriteDatabase
#4188
Conversation
Yep, this is pretty much what I was thinking. It might be nice to check for nesting somehow, but I'm not sure it's worth the trouble or complications for users. And maybe we should have fuzz_one_input use this? |
hmm, without a way to expose |
Eh, fair enough. Let's just suggest in the |
def fetch(self, key: bytes) -> Iterable[bytes]: | ||
return self._db.fetch(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a convenient way to also retrieve the enqueued-but-not-finalized values? Should we wait for the queue to empty (at least of writes), and then fetch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want to deal with retrieving enqeueued-but-not-finalized values because then we have to replicate the semantics of move
+ delete
, and may start disagreeing with an unsound database which doesn't respect the method contracts. Which wouldn't really be our fault, but still.
I think joining on fetch would be reasonable? (note that the queue is only writes, fetches aren't enqueued). Possibly we want a join: bool = True
or timeout: int | None = None
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"join before fetch" cleans up test usages as well, which makes me more confident this is the correct default behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, yeah, join-on-fetch is clearly the way to go 👍
See Zac-HD/hypofuzz#41 (comment); was something like this what you were thinking of?
(I expect coverage to fail here; explicit covering test pending)