kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.36k stars 96 forks source link

Bug: Multiple imports from JSON fails #4403

Open chrisjsewell opened 6 hours ago

chrisjsewell commented 6 hours ago

Kùzu version

v0.6.1

What operating system are you using?

Ubuntu, Windows

What happened?

Importing data using https://docs.kuzudb.com/extensions/json/ across multiple connections fails, seemingly because closing the connection does not properly clean up

Are there known steps to reproduce?

example code:

db = kuzu.Database(path1)
with kuzu.Connection(db) as conn:
    conn.execute(f"COPY Node FROM 'import.json'")

db = kuzu.Database(path2)
with kuzu.Connection(db) as conn:
    conn.execute(f"COPY Node FROM 'other.json'")

linux ubuntu:

Fatal Python error: Segmentation fault

Thread 0x000075b10b2e6740 (most recent call first):
  File "/home/runner/actions-runner/_work/ubcode/ubcode/.venv/lib/python3.12/site-packages/kuzu/connection.py", line 130 in execute

windows:

RuntimeError: IO exception: Cannot open file. path: C:\Users\username/.kuzu/extension/0.6.1/win_amd64/libjson.kuzu_extension - Error 32: The process cannot access the file because it is being used by another process
acquamarin commented 4 hours ago

Hi @chrisjsewell This is a known issue in windows. Two processes can't load the same extension at the same time because of the limitation set by windows., while linux/mac doesn't have such limitation. As a temporary workaround, can you serialize your copy statements instead of running them in parallel?

Thanks! Ziyi