summaryrefslogtreecommitdiff
path: root/runtime/client.zig
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/client.zig')
-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).