summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/replica.zig12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/replica.zig b/core/replica.zig
index 71a8de71..01a532b5 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -2936,7 +2936,10 @@ fn sameBuild(gpa: Allocator, j: Joined, why: []u8) ?Joined {
/// The session again, after a divergence or an upgrade: an upgrade's
/// takes the time its exec and load take, and its daemon's, so it is
-/// dialled every 100 ms for 20 s. Null, and why in `why`.
+/// dialled every 100 ms for 20 s. Null, and why in `why`. The session's
+/// own word that it is upgrading (`Peers.refuseAll`, until its exec) is
+/// not a try: it is there, writing its dump for as long as that takes (a
+/// 24 s write let every client go for good, 2026-11-22).
/// `patient`: after an Upgrade's `refused` alone, while the session is
/// away a moment; after a divergence a session that will not answer is
/// gone, and the client says so at once (it froze 20 s, 2026-10-30).
@@ -2944,7 +2947,7 @@ fn sameBuild(gpa: Allocator, j: Joined, why: []u8) ?Joined {
/// none for a first join that met an Upgrade.
fn redial(gpa: Allocator, path: []const u8, session: []const u8, why: *[600]u8, have: ?*Have, patient: bool, view: ?u8) ?Joined {
var tries: u32 = 0;
- while (true) : (tries += 1) {
+ while (true) {
why.* = @splat(0);
if (dial(gpa, path, session, why, have, view)) |j| return sameBuild(gpa, j, why);
// Another build, or another protocol (the daemon moved with its
@@ -2957,7 +2960,10 @@ fn redial(gpa: Allocator, path: []const u8, session: []const u8, why: *[600]u8,
// Its daemon lists no such session: it is gone, not away a moment
// (an Upgrade keeps it listed throughout).
if (std.mem.startsWith(u8, words, "no session called ")) return null;
- if (!patient or tries > 200) return null;
+ if (!std.mem.eql(u8, words, upgrading)) {
+ if (!patient or tries > 200) return null;
+ tries += 1;
+ }
const ts: libc.timespec = .{ .sec = 0, .nsec = 100 * std.time.ns_per_ms };
_ = libc.nanosleep(&ts, null);
}