summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-20 11:17:46 -0300
committerGabriel Schneider <[email protected]>2026-11-20 12:30:53 -0300
commit20f08450aee2487809feb6442ec44e21d2436e5d (patch)
treea6eda48cc7988b37019a98b914486cd04642e31a /runtime
parent35b2c0efc6c43ba44640f4432d98734000f8887a (diff)
parent23de206007ebae87007460afa993338781a03076 (diff)
downloadpardes-20f08450aee2487809feb6442ec44e21d2436e5d.tar.gz
pardes-20f08450aee2487809feb6442ec44e21d2436e5d.zip
integration (the terminals' line, NOT the main line yet): a client that falls behind lets go and joins again, a join's reloads never dropped and only of the terminals written, on the first client and the pair: pardes-term-join (with pardes-term-lag under it) and pardes-merge35; three conflicts, each two sides adding at one place: the tests at the end of core/replica.zig (both kept), the soak's fields and its end's checks in test/replicas.zig (the images' and the far client's both kept); one name follows: Peer.writeLoop's local for a cut link was named last, which the first client's Peer.last now is (cut_off); tui core-test 861/1018 (157 skipped), shell-test 1058/1061, term-test 18/18, the window builds; the soak, screen state: diverged 0, unequal 0, unlisted 0; BYTES: seed 0 at 30 ms two clients diverged (client 2 at digest 29, client 3 at digest 2): the divergence the join's report left open, here on the merged session: this line stays beside the main one until that soak is clean
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'runtime')
-rw-r--r--runtime/client.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/client.zig b/runtime/client.zig
index 1314d3fb..7c0bcb7f 100644
--- a/runtime/client.zig
+++ b/runtime/client.zig
@@ -138,8 +138,9 @@ pub fn Loop(comptime Frontend: type) type {
l.link.take(msg);
}
- /// A join a pass: the first, and one after the replica diverged or
- /// the session let it go to upgrade; the frontend stays as it is.
+ /// A join a pass: the first, and one after the replica diverged, fell
+ /// too far behind (replica.behind_max_ms) or the session let it go
+ /// (to upgrade, or cut off); the frontend stays as it is.
pub fn run(l: *L, s: *Start) !Ended {
const link = &l.link;
while (true) {
@@ -152,7 +153,7 @@ pub fn Loop(comptime Frontend: type) type {
l.after();
}
if (s.env.get("PARDES_REPLICA_STATS")) |file| link.writeStats(file);
- if (!link.gone) replica.bye(s.joined.fd, s.r.diverged != null);
+ if (!link.gone) replica.bye(s.joined.fd, s.r.diverged != null or link.lagged != 0);
// The link's reader ends with the link, posting as it goes:
// what it posted is let go until it has (a terminal's queue
// is bounded: a reader blocked on it would never end).