Skip to content

perf(daemon): scope sync.family's trace fence to the requested family - #2030

Merged
svarlamov merged 1 commit into
mainfrom
fix/per-family-trace-fences
Aug 3, 2026
Merged

perf(daemon): scope sync.family's trace fence to the requested family#2030
svarlamov merged 1 commit into
mainfrom
fix/per-family-trace-fences

Conversation

@svarlamov

@svarlamov svarlamov commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • sync.family previously waited on the global trace fence, so an open mutating trace root in repo A could delay synchronization for unrelated repo B.
  • Attribute roots to repository families using the already-maintained root_families map and add a family-scoped fence that ignores roots known to belong to a different family.
  • Preserve fail-closed behavior: roots whose family is not known still block every family.
  • Keep global consumers (await and shutdown drain) on the global fence.

TDD / regression coverage

  • Added a Unix two-TestRepo behavioral test that holds repo A's mutating trace root open, proves repo A's own sync.family stays blocked, and proves repo B synchronizes before repo A closes.
  • Verified the test fails on current main (repo B times out) and passes on this branch.
  • Retained unit coverage for unattributed roots, other-family release, own-family blocking, and terminal release.
  • Full task test, task lint, task fmt, and git diff --check are green locally after restacking onto current main.

This re-lands the per-family fence idea from #1980 on the current trace2 architecture. It adds no Git spawn, object/ref lookup, or file read to the ingestion path.

svarlamov commented Jul 29, 2026

Copy link
Copy Markdown
Member Author

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Base automatically changed from feat/agent-usage-memory-limiter to main August 2, 2026 20:02
sync.family waited on the global trace fence, so an open mutating trace root in repository A delayed synchronization and test drains for unrelated repository B.

Use the existing trace2-captured root family attribution to ignore roots already assigned to another family. Unattributed roots continue to fail closed, the requested family still waits for its own roots, and global consumers such as await and shutdown retain the global fence.

Add internal fence coverage plus a two-TestRepo regression proving an unrelated family completes while the originating family remains blocked until the trace root closes.

Re-lands the per-family fence idea from #1980 on the current architecture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@svarlamov
svarlamov force-pushed the fix/per-family-trace-fences branch from 4888713 to 52c908e Compare August 2, 2026 22:00
@svarlamov
svarlamov merged commit cb748e6 into main Aug 3, 2026
49 of 51 checks passed
@svarlamov
svarlamov deleted the fix/per-family-trace-fences branch August 3, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant