-
Notifications
You must be signed in to change notification settings - Fork 494
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
apoc.load.csv does not close the file on consumption end #4078
Labels
Comments
The error seems to occur also without It could probably be an error in neo4j itself, as the code regarding apoc.load.csv has not changed. I opened an issue on the neo4j kernel repository, to investigate both sides: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use Python to preprocess a file and then load it into the database. More specifically, I have defined the following import flow:
1. Users specify the location of the input file
2. The code preprocesses the file
3. The code requests the import directory and moves it to the import folder of the database
4. The file is imported using
apoc.load.csv
5. Once the import is done, I tidy up by deleting the file from the import folder.
However, after recently upgrading my database from version 5.9.0 to 5.10.0, I'm not allowed to delete the file from the import folder, as it is still being consumed by the database. The error still prevails in version 5.17 (last tested).
Expected Behavior (Mandatory)
After a file imported using
apoc.load.csv
, the file should be closed on consumption end, so that other processes can access the file.Actual Behavior (Mandatory)
The issue arises when I attempt to delete the file post-import. I encounter a PermissionError, signaling that the file is still in use by another process. It seems the database is holding onto the file longer than anticipated, causing a conflict with my cleanup operation.
More specifically, I get this error:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: '<ne04j>\\import\\import_file.csv
How to Reproduce the Problem
Simple Dataset (where it's possibile)
The specific dataset does not matter, it happens with any dataset I try to import.
Python Code
This is the Python code I use to import and delete the file.
Steps (Mandatory)
apoc.load.csv
with the Python neo4j driverSpecifications (Mandatory)
Currently used versions
Versions
The text was updated successfully, but these errors were encountered: