Repository navigation
perf(sync): carry every sync source over one socket - #358
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 31, 2026 in 22s
Confidence 8/10 · No issues found
🟢 Confidence 8/10 · likely safe to merge. Held at 8 because earlier reviews of this pull request found 1 defect.
no findings · tests covered · risk high −1 · 1 defect fixed in earlier rounds
Follow-up to the sync mux: open is now the acquire of an acquireRelease, so a stream closed while its object socket is still being opened closes that socket instead of leaking it. Safe to merge.
relayopens the object socket as anacquireReleaseacquire, closing it in the release- New test covers a
Closearriving while the object is still answering
Fixed since the last review
- ✅
F1 · A stream closed while it is still opening leaks its object socket
Production impact
Production traffic of the changed files (last 7 days)
| File | Calls/day | Busiest operations |
|---|---|---|
apps/backend/src/worker/sync-route.ts |
1.7k | GET 964/day, 1.4% errGET 704/day, 11.1% err |
Telemetry this change adds and removes (3)
- ➕ span name
SyncMux.open·apps/backend/src/worker/sync-route.ts:290 - ➕ attribute
sync.source·apps/backend/src/worker/sync-route.ts:291 - ➕ span name
SyncRoute.muxUpgrade·apps/backend/src/worker/sync-route.ts:329
What was checked
acquireReleasemasks the acquire uninterruptibly and registers the release as a finalizer (internal/effect.ts:3800)FiberMap.removeawaits the interrupt (FiberMap.ts:573), so the release runs before theCloseframe is done- The regression test pins the mid-open
Close: before the fix the answer arrives with nothing to close it
920af6f · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading