Distribution: each wait of a publish logged with its time; the window's learning no longer holds the answer

Builds: design 47 G (publish path of oci-artifact-registry; no design line covers the log lines)
This commit is contained in:
2026-11-15 01:20:04 +01:00
parent e8204a9c27
commit 99f3e23492
3 changed files with 58 additions and 6 deletions
@@ -249,10 +249,21 @@ func tools(v *holder.Verbs, windows kept[holder.Window]) []stdio.Tool {
if err != nil {
return nil, err
}
a, err := v.Publish(seat, stdio.CallerOf(args), publishOf(in))
caller := stdio.CallerOf(args)
start := time.Now()
logf("%s.publish received from %s: %s %s (%s, %d parts)", seat, caller, in.Name, in.Version, in.Kind, len(in.Parts))
a, err := v.Publish(seat, caller, publishOf(in))
if err == nil {
learnPublishing(windows, stdio.CallerOf(args))
// The window's learning asks the delivery view (up to 60 s, past the runner's 30 s call bound),
// so it never holds the answer.
go func() {
t := time.Now()
logf("learning the publishing build of %s starts (mesh-delivery-view.node_haves)", caller)
learnPublishing(windows, caller)
logf("learning the publishing build of %s ended after %s", caller, time.Since(t).Round(time.Millisecond))
}()
}
logf("%s.publish from %s answered after %s (error: %v)", seat, caller, time.Since(start).Round(time.Millisecond), err)
return publishAnswer(a), err
}},
stdio.Tool{Name: seat + "." + holder.VerbPublishPart, Description: "Send one chunk (at most 1 MiB) of one part of an open transfer, from the caller that opened it.",
@@ -468,7 +479,7 @@ func main() {
}()
base, _ := url.Parse("http://127.0.0.1:5001")
store := &holder.OCI{Base: base, Upstream: &holder.Upstream{}}
h := &holder.Holder{Objects: parts.BusObjects(holder.IncomingObjects), Builder: holder.Reserved{Ask: stdio.Ask}, Store: store, Say: say, Finding: findings.Say,
h := &holder.Holder{Logf: logf, Objects: parts.BusObjects(holder.IncomingObjects), Builder: holder.Reserved{Ask: stdio.Ask}, Store: store, Say: say, Finding: findings.Say,
Transfers: parts.BusTransfers[holder.Opening](holder.TransfersState), Cap: parts.BusCap(holder.IncomingObjects), Record: recordAct, Idle: parts.BusArm(holder.IdleState)}
files := &holder.Files{Container: or(os.Getenv("MESH_REGISTRY_CONTAINER"), "mesh-registry"), Run: holder.ExecRunner, UID: os.Getuid()}
v := &holder.Verbs{Holder: h, Catalog: store, Holds: kept[holder.Hold]{state: "holds", key: holder.Hold.Key}, Mirrors: mirrors{},