milestone 17: real deadlines, validator holes, upstream editor, trusted proxies, contract samples, badvers
This commit is contained in:
+6
-4
@@ -922,9 +922,11 @@ fn probeUpstreams(r: Runner, cfg: model.Config) !usize {
|
||||
const response_buf = try r.gpa.alloc(u8, transport.max_message_len);
|
||||
defer r.gpa.free(response_buf);
|
||||
|
||||
const attempt_timeout: std.Io.Clock.Duration = .{
|
||||
.raw = model.totalTimeout(cfg.upstream),
|
||||
.clock = .awake,
|
||||
// The same pair the server runs with, so a probe that passes here says
|
||||
// something about the deadlines a real query will get.
|
||||
const timeouts: pool.Timeouts = .{
|
||||
.attempt = .{ .raw = model.attemptTimeout(cfg.upstream), .clock = .awake },
|
||||
.total = .{ .raw = model.totalTimeout(cfg.upstream), .clock = .awake },
|
||||
};
|
||||
// The pool jitters backoff from this; one probe per upstream never reaches
|
||||
// backoff, so the value only has to be a value.
|
||||
@@ -978,7 +980,7 @@ fn probeUpstreams(r: Runner, cfg: model.Config) !usize {
|
||||
.enabled = true,
|
||||
.health = .init,
|
||||
}};
|
||||
var single: pool.Pool = .init(&entries, .{}, attempt_timeout, seed);
|
||||
var single: pool.Pool = .init(&entries, .{}, timeouts, seed);
|
||||
|
||||
if (single.exchange(r.io, probe_query, response_buf)) |_| {
|
||||
try r.out.print("OK upstreams[{d}] {f}\n", .{ i, safe_url.redact(server.url) });
|
||||
|
||||
Reference in New Issue
Block a user