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

pd.EmptyData error in concurrent access from_file and store method #273

Open
mpvanderschelling opened this issue Jun 26, 2024 · 0 comments

Comments

@mpvanderschelling
Copy link
Collaborator

The Problem

While one process invokes the store() method and another process tries to read the ExperimentData object (from_file()), there is the possibility that when the _Data object invokes the to_csv method, the object is read from disk.
Because the to_csv method first empties the files and then reads to it, the file can be read empty. This creates an pd.EmptyDataError. Especially when a large number of experiments need to be written.

Possible solution

Work with temporary file creation:
store()

  1. to_csv to .tmp file
  2. Rename the file to .csv
  3. Remove the `.tmp file

from_file()

  1. Check for .tmp files in path. If exists, retry later
  2. If no `.tmp files, open like normally
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

No branches or pull requests

1 participant