From 89e63aa49b9f9c07809656d412d67271a68cc79f Mon Sep 17 00:00:00 2001 From: Sleeep <91170291+sleeepyin@users.noreply.github.com> Date: Thu, 13 Nov 2025 15:52:14 +0800 Subject: [PATCH 1/2] Update edge keywords extraction in graph visualization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 构建neo4j时候 关键字的取值默认为d7 应该为修改后的d9 --- examples/graph_visual_with_neo4j.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/graph_visual_with_neo4j.py b/examples/graph_visual_with_neo4j.py index 1cd2e7a3..b1fc9438 100644 --- a/examples/graph_visual_with_neo4j.py +++ b/examples/graph_visual_with_neo4j.py @@ -53,8 +53,8 @@ def xml_to_json(xml_file): "description": edge.find("./data[@key='d6']", namespace).text if edge.find("./data[@key='d6']", namespace) is not None else "", - "keywords": edge.find("./data[@key='d7']", namespace).text - if edge.find("./data[@key='d7']", namespace) is not None + "keywords": edge.find("./data[@key='d9']", namespace).text + if edge.find("./data[@key='d9']", namespace) is not None else "", "source_id": edge.find("./data[@key='d8']", namespace).text if edge.find("./data[@key='d8']", namespace) is not None From 4343db753a05995563b9ab02fcc35c49bb1ef6e3 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 15 Nov 2025 00:58:23 +0800 Subject: [PATCH 2/2] Add macOS fork safety check for Gunicorn multi-worker mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Check OBJC_DISABLE_INITIALIZE_FORK_SAFETY • Prevent NumPy/Accelerate crashes • Show detailed error message • Provide multiple fix options • Exit early if misconfigured --- lightrag/api/run_with_gunicorn.py | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lightrag/api/run_with_gunicorn.py b/lightrag/api/run_with_gunicorn.py index 0de2ac36..deabe7cf 100644 --- a/lightrag/api/run_with_gunicorn.py +++ b/lightrag/api/run_with_gunicorn.py @@ -76,6 +76,39 @@ def main(): print("=" * 80 + "\n") sys.exit(1) + # Check macOS fork safety environment variable for multi-worker mode + if ( + platform.system() == "Darwin" + and global_args.workers > 1 + and os.environ.get("OBJC_DISABLE_INITIALIZE_FORK_SAFETY") != "YES" + ): + print("\n" + "=" * 80) + print("❌ ERROR: Missing required environment variable on macOS!") + print("=" * 80) + print("\nmacOS with Gunicorn multi-worker mode requires:") + print(" OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES") + print("\nReason:") + print(" NumPy uses macOS's Accelerate framework (Objective-C based) for") + print(" vector computations. The Objective-C runtime has fork safety checks") + print(" that will crash worker processes when embedding functions are called.") + print("\nCurrent configuration:") + print(" - Operating System: macOS (Darwin)") + print(f" - Workers: {global_args.workers}") + print( + f" - Environment Variable: {os.environ.get('OBJC_DISABLE_INITIALIZE_FORK_SAFETY', 'NOT SET')}" + ) + print("\nHow to fix:") + print(" Option 1 - Set environment variable before starting (recommended):") + print(" export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES") + print(" lightrag-server") + print("\n Option 2 - Add to your shell profile (~/.zshrc or ~/.bash_profile):") + print(" echo 'export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES' >> ~/.zshrc") + print(" source ~/.zshrc") + print("\n Option 3 - Use single worker mode (no multiprocessing):") + print(" lightrag-server --workers 1") + print("=" * 80 + "\n") + sys.exit(1) + # Check and install dependencies check_and_install_dependencies()