0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/crates/sync/src
Wing 1a7dc2e49c engine: a shut-down engine is freed (two holds kept its whole graph alive)
local_first's online_runtime_shutdown_stops_edge_workers_and_retires_the_graph
failed every time ("engine graph still reachable after shutdown + drop").
CI never ran it (scripts/ci/test-core.sh lists the engine tests it runs).
After shutdown + drop the doc host stayed at 2 strong references for good;
tracking every DocHost clone named both:

- The version-change hook (zeron_update::set_before_restart, c004d547c)
  is process-wide and captured the doc host and workspace strongly, so
  every engine ever assembled in the process stayed alive. It now holds
  them weakly and upgrades when it runs: only this process's live engine
  restarts it (the CLI never sets a hook), and with its graph gone there
  is nothing left to prepare.
- A cycle: the engine holds its plugins (sessions.set_plugins), the
  plugins' agents hold their host (EngineAgentHost, 564da4414), and the
  host holds the doc host, sessions and workspace. Plugins::shutdown now
  lets go of that host, as shutdown already breaks the sessions <-> doc
  host cycle. (The agents' sink holds the plugins weakly; left alone.)

Each alone still leaks (the test fails with either fix undone); with
both it passes, 5/5. A new restart_hook test (its own binary: the hook
is process-wide) shows the hook still prepares the running engine's
store and holds nothing after shutdown; with the old strong hook it fails.

The test's next check then failed on this Mac only: one `HEAD /` after
shutdown. lsof named the sender: the Zeron Engine already running on
the Mac, whose preview discovery probes this process's listeners (a
listener bound after shutdown got probed too). Not the engine under
test, so the counting edge leaves `HEAD /` out, as the client tests'
mock edge already does; the engine sends the edge no `HEAD /`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
History 2026-11-11 13:38:55 -07:00
..
chat_client Chat client: relay frames go out during the backfill and checkpoint fetch 2026-11-07 11:05:32 -07:00
chat_relay Relay: a frame the room's queue can't take yet waits, in order 2026-11-10 22:33:27 -07:00
registry Tests: own lastSeenAt after every socket drops; same editor re-asking for its queue lease 2026-11-11 01:18:13 -07:00
socket Reduce redundant sync traffic and keep slow transfers progressing 2026-09-15 21:25:52 +00:00
attachment_store.rs Keep every send until its person removes it 2026-11-06 23:36:10 -07:00
budget.rs Engine idle: views' streams close with their handle; no lost socket waiter 2026-11-11 05:01:11 -07:00
chat_client.rs Merge zeron/relay-mobile-ios (518ba017): reconnect and woken-host fixes 2026-11-07 13:27:47 -07:00
chat_frames.rs Relay layer: old readers, phones, rollback and local-first 2026-11-06 14:26:05 -07:00
chat_relay.rs Relay: a frame the room's queue can't take yet waits, in order 2026-11-10 22:33:27 -07:00
dial.rs Chats reach long chats on other devices (#1307) 2026-11-09 06:28:32 -07:00
held_sends.rs Keep every send until its person removes it 2026-11-06 23:36:10 -07:00
lib.rs Merge zeron/cloud-attachments-r2 2026-11-07 19:37:42 -07:00
net_path.rs sync: event-driven reconnects — online-bus everywhere, path monitor, tighter caps 2026-08-19 06:08:32 +00:00
registry.rs Registry: a rejoin beats only for a host still beating; steady beats don't republish 2026-11-11 01:43:35 -07:00
socket.rs Chats reach long chats on other devices (#1307) 2026-11-09 06:28:32 -07:00
store.rs engine: a shut-down engine is freed (two holds kept its whole graph alive) 2026-11-11 13:38:55 -07:00
store_recovery.rs A damaged chat store is found, kept aside and rebuilt 2026-11-07 04:28:44 -07:00
sync_jobs.rs Engine: an idle engine wakes for nothing 2026-11-11 04:50:38 -07:00
types.rs Fix token refresh storms and preserve sessions during transient DNS failures (#352) 2026-09-17 19:36:35 +00:00
wake.rs A phone at rest holds no sockets, and a new network path checks its rooms 2026-11-07 03:52:19 +00:00