Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

[upstream-sync] fix(engine): scope GC-sweep read transaction to list_tombstones only (upstream #2004) #175

Description

@github-actions

Upstream Change Summary

Type: bug-fix
Difficulty: Easy
Recommendation: Adopt

Committer::launch_child_component_gc previously borrowed a read transaction from commit() and held it open through the entire spawn-and-await loop over child delete tasks. The fix opens a new read transaction scoped strictly to the list_tombstones call and drops it before spawning child tasks. With backends whose ReadTxn pins a shared resource (e.g., a fixed-size connection pool), holding the rtxn across async spawning could deadlock once cascade depth × per-level fanout exceeds capacity. LMDB's single-writer design doesn't surface this today, but the lifetime discipline is correct regardless and future-proofs the engine for alternative state-store backends.

Upstream References

Relevant Upstream Files / Areas

  • rust/cocoindex/src/engine/Committer::launch_child_component_gc, commit()

Recoco Considerations

  • Affected files: crates/recoco-core/src/engine/ (committer module, GC sweep)
  • Small, targeted lifetime fix — open a fresh RoTxn inside launch_child_component_gc, use it only for list_tombstones, drop before the async spawn-and-await block
  • No Python code to exclude; no feature-gating required
  • Aligns with recoco's correctness-first philosophy and prepares for potential future non-LMDB state-store backends

Integration Notes

This is a 5–10 line change in the committer. Identify the equivalent launch_child_component_gc function in recoco's engine code and verify it has the same rtxn lifetime pattern before applying. The fix is purely a scope narrowing — no API or behavior change.

Activity

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

    claudeCreated or actioned by Claude AIupstream-syncIssues for syncing updates with our upstream (cocoindex-io/cocoindex)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions