diff options
Diffstat (limited to 'runtime/client.zig')
| -rw-r--r-- | runtime/client.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/client.zig b/runtime/client.zig index 7941889e..55171af2 100644 --- a/runtime/client.zig +++ b/runtime/client.zig @@ -182,8 +182,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; // Its start path's file, for an Upgrade's question (`upgrade`). @@ -198,7 +199,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, .{ .again = s.r.diverged != null, .close = link.close }); + if (!link.gone) replica.bye(s.joined.fd, .{ .again = s.r.diverged != null or link.lagged != 0, .close = link.close }); // 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). |
