8000 checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001 · Issue #734 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001 #734

Closed

Description

@adityamukho

Problem

Minigraf::checkpoint, verify and rebuild_indexes take inner.write_lock without the is_write_tx_active() check that execute, query, fact_log and begin_write make. Called on a thread that holds a WriteTransaction, they lock a std::sync::Mutex the same thread already holds: a deadlock (or a panic, as std leaves same-thread re-locking unspecified), instead of INT-001.

let db = Minigraf::open("x.graph")?;
let tx = db.begin_write()?;
db.checkpoint()?; // hangs
  • v3: src/db.rs checkpoint_inner (~1102), verify_inner (~1138), rebuild_indexes_inner (~1183)
  • main (v2.x): checkpoint_inner (src/db.rs:729); verify/rebuild_indexes are v3-only

Minigraf::prepare, PreparedQuery::execute and PreparedQuery::query also skip the check. They take no write lock, so they do not deadlock, but they are inconsistent with execute/query.

Fix

Add the is_write_tx_active() → INT-001 check to each, with a test per method. Found while reviewing the #180 spec (PR #730), whose re-entry rules depend on these guards.

🤖 Generated with Claude Code

Activity

  1. added this to the v3.0.0 milestone on Oct 24, 2026
  2. added
    bugSomething isn't working
    known-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue
    on Oct 24, 2026
  3. added a commit that references this issue on Oct 24, 2026
  4. added 5 commits that reference this issue on Oct 24, 2026
  5. adityamukho commented on Oct 24, 2026

    @adityamukho
    CollaboratorAuthor

    Fixed on v3 in #739 (7f90e95) and on main in #740 (b3b3975). Stays open until the v2.x patch with the fix is published.

  6. added a commit that references this issue on Oct 26, 2026
  7. adityamukho commented on Oct 26, 2026

    @adityamukho
    CollaboratorAuthor

    Fixed in v2.0.11, now published: https://github.com/project-minigraf/minigraf/releases/tag/v2.0.11. The v2.x fix shipped in #740; v3.0.0 is also fixed in #739. Updated the pinned known-issues list (#421).

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

    bugSomething isn't workingknown-issueBug present in a published release and not yet fixed in one; listed in the pinned known-issues issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0