Skip to content

ENH: HDFStore.flush() to optionally perform fsync (GH5364) #5369

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

Merged
merged 2 commits into from
Oct 29, 2013

Conversation

benalexau
Copy link
Contributor

Pull request for #5364.

The fsync=False parameter was added to flush given this offers utility for non-distribution use cases, such as a user just wanting to ensure their data is regularly flushed to disk.

I could not see any mocking library in use in the Pandas tests, so I skipped adding one just to verify os.fsync actually gets called.

@jtratner
Copy link
Contributor

For now, probably not worth it, because we don't have much that really needs it (might be nice for network tests but a little too late now).

distributed lock manager to ensure there is only a single writer at a
time and all readers close the file during writes and re-open it after any
writes. In this case you should use ``store.flush(fsync=True)`` prior to
releasing any write locks. See the issue (:`5364`) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you shorten this to:

If you use locks to manage write access between multiple processes, you may want to use :py:func:`~os.fsync` before releasing write locs. For convenience you can use ``store.flush(fsync=True)`` to do this for you.

TST: Modifications to unit test following PR 5369 review.
jreback added a commit that referenced this pull request Oct 29, 2013
ENH: HDFStore.flush() to optionally perform fsync (GH5364)
@jreback jreback merged commit caee121 into pandas-dev:master Oct 29, 2013
@jreback
Copy link
Contributor

jreback commented Oct 29, 2013

thanks for this!

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.

3 participants