Skip to content

bug(graph): One transient failure permanently disables FalkorDB for the whole process #1388

Closed

Description

@Shashankss1205

core/__init__.py:24, 51-59, 174, 238; core/database_falkordb.py:84, 165-168, 234, 237

_FALKORDB_DISABLED = False
def mark_falkordb_unavailable() -> None:
    global _FALKORDB_DISABLED
    _FALKORDB_DISABLED = True     # never reset

class FalkorDBManager:
    _startup_failed = False       # class attribute, never reset

Reproduced. A failing path followed by the known-good global path in the same process:

1st manager: KuzuDBManager
_FALKORDB_DISABLED: True
2nd manager (should be FalkorDB): KuzuDBManager  /home/claude/.codegraphcontext/global/db/kuzudb

Impact. In the long-running MCP server, switch_context_tool (server.py:517, 583) switching to a per-repo context whose FalkorDB can't start poisons the flag. Every subsequent context — including switching back to the working global one — silently returns a KuzuDBManager. The user's indexed graph becomes invisible and all further writes go to a second store.

Fix. Scope the failure flag to the specific (db_path, socket_path) pair and clear it on close_driver(teardown=True) / context switch.


Related existing issues

Filed separately because the root cause and fix differ; close as a duplicate if maintainers judge otherwise.


Audit environment
Version codegraphcontext 0.5.2 (PyPI)
Commit df3af04
Backend FalkorDB Lite (falkordblite 0.9.0), Python 3.12.3, Linux
Corpus the CodeGraphContext repo itself — 784 files, 23 languages, 5,501 Function nodes

Audit ID G-H03 · severity high · from an end-to-end audit of CGC 0.5.2 (63 findings). Reported with the reproduction as run.

Activity

  1. added
    bugSomething isn't working
    severity: highWrong graph content, data loss, or a broken workflow with no clear signal
    area: graphDatabase abstraction, Cypher generation, schema, bundles
    on Jul 26, 2026
  2. github-actions commented on Jul 26, 2026

    @github-actions
    Contributor

    Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

  3. moved this from Backlog tasks to In progress in CGC Progress Boardon Jul 26, 2026
  4. moved this from In progress to Done in CGC Progress Boardon Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: graphDatabase abstraction, Cypher generation, schema, bundlesbugSomething isn't workingseverity: highWrong graph content, data loss, or a broken workflow with no clear signal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions