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

Add a blocking commit after each modification if autocommit is enabled. #94

Merged
merged 9 commits into from
Jan 1, 2020
Merged

Conversation

endlisnis
Copy link
Contributor

@endlisnis endlisnis commented Mar 24, 2019

This change modifies how "autocommit" works. It forces each modification to block until the commit is complete. Without this, if the program exited after modifying the sqlitedict, the changes might not make it to disk. With this change, all changes are guaranteed to be on disk before the modification action returns.

Fixes #93 .

Copy link
Collaborator

@mpenkov mpenkov left a comment

Choose a reason for hiding this comment

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

The changes make sense to me.

Could you please add some tests? Ideally, the tests should fail without your modified code, illustrating a problem with the implementation. Obviously, the tests should pass once your modified code is in place.

@endlisnis
Copy link
Contributor Author

Sorry for the delay, but I finally have a working test for this. Because this bug only shows up near program exit, I had to create a test that launches python in a subprocess, and because of path issues, I had to add a symlink for sqlitedict.py into the tests directory (or else my tests were picking up the system version of the library).

@endlisnis
Copy link
Contributor Author

Is there anything more I need to do before this can be merged?

@mpenkov
Copy link
Collaborator

mpenkov commented Sep 12, 2019

Sorry, I've been a bit busy lately. No, there's nothing else you need to do, please leave it with me.

@endlisnis
Copy link
Contributor Author

I'm eager to get this merged into the main release. I'd like to use this library at work, but they would prefer running a vanilla version of the software, and my use case will not work without this patch.

@piskvorky
Copy link
Owner

@endlisnis thanks for your patience. @mpenkov will be back to open source after the New Year!

Copy link
Collaborator

@mpenkov mpenkov left a comment

Choose a reason for hiding this comment

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

Alright, I'm finally back and had a chance to look at your tests. It's a step in the right direction, but could be better. Please have a look at the questions and comments I left.

@endlisnis endlisnis requested a review from mpenkov December 29, 2019 16:35
@endlisnis
Copy link
Contributor Author

I have completed all the requested changes. Please let me know if there is anything more you'd like me to do.

@endlisnis endlisnis requested a review from mpenkov January 1, 2020 14:39
@mpenkov mpenkov merged commit f5c57f1 into piskvorky:master Jan 1, 2020
@mpenkov
Copy link
Collaborator

mpenkov commented Jan 1, 2020

OK, merged. Thank you for your hard work and your patience!!

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.

autocommit does not commit if program exits
3 participants