The runtime answers a page of a kept state in one request, bounded by time (issue 1966, recovery) #64

Merged
mesh-tools merged 4 commits from fix/1966-views-page-time into main 2026-11-09 08:13:14 +00:00
Showing only changes of commit 2135fed6cf - Show all commits
+5 -1
View File
@@ -166,6 +166,7 @@ func (c *Conn) StatePage(module, name, after string, maxBytes int, budget time.D
}
// The bind and the listing have a StateTimeout of their own, and each get another: the page's time budget is what
// ends a slow page (with Next), never a deadline spread over the whole of it.
// ctx covers the bind and the listing alone; every bus request inside the loop takes each().
ctx, cancel := context.WithTimeout(context.Background(), StateTimeout)
defer cancel()
each := func() (context.Context, context.CancelFunc) {
@@ -186,7 +187,10 @@ func (c *Conn) StatePage(module, name, after string, maxBytes int, budget time.D
}
kv, bound := buckets[node]
if !bound {
if kv, err = fam.Open(ctx, node); err != nil {
octx, ocancel := each() // the open is a bus request in the loop: its own deadline, never ctx's
kv, err = fam.Open(octx, node)
ocancel()
if err != nil {
return nil, err
}
buckets[node] = kv