grants: make each seat's ask stream the bus lacks, from the seat list
The pipeline runner's step ask to mesh-builds timed out: it publishes on the seat's accept subject through JetStream and no stream held mesh.seat.mesh-builds.accept.>. Before G the controller made SEAT_<SEAT> for every seat that accepts work; the seats whose queues came with G (mesh-builds, mesh-wants) had none. The grants part now makes each such stream, from the seat list, at every pass, as it makes the seats' kept-event streams: only where the bus holds none.
This commit is contained in:
@@ -124,3 +124,28 @@ func SplitKept(kept []KeptEvent, consumes []string) (rest []string, hears []Hear
|
||||
}
|
||||
return rest, hears
|
||||
}
|
||||
|
||||
// AskStreamsOf is the work-queue stream of each seat of the seat list that accepts work (SeatStreams' rule, design 47 G §544):
|
||||
// `SEAT_<SEAT>` on `mesh.seat.<seat>.accept.>`, kept seven days, so an ask is held until one holder takes it, and a JetStream
|
||||
// publish of an ask is answered by the bus. Before G the controller made these; a seat whose queues came with G (mesh-builds,
|
||||
// mesh-wants) had none, so every ask to it timed out unanswered (lead-47, 2026-11-15). Sorted by stream.
|
||||
func AskStreamsOf(defs map[string]seatdef.Definition) []jetstream.StreamConfig {
|
||||
var seats []DeclaredSeat
|
||||
for _, d := range defs {
|
||||
if len(d.Accepts) == 0 || !safeSubject.MatchString(d.Seat) {
|
||||
continue
|
||||
}
|
||||
var accepts []string
|
||||
for _, a := range d.Accepts {
|
||||
accepts = append(accepts, a.Name)
|
||||
}
|
||||
seats = append(seats, DeclaredSeat{Name: d.Seat, Accepts: accepts})
|
||||
}
|
||||
var out []jetstream.StreamConfig
|
||||
for _, st := range SeatStreams(seats) {
|
||||
out = append(out, jetstream.StreamConfig{Name: st.Name, Description: st.Why, Subjects: st.Subjects,
|
||||
Retention: jetstream.WorkQueuePolicy, Storage: jetstream.FileStorage, Replicas: 1,
|
||||
MaxAge: time.Duration(st.MaxAge) * time.Second})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user