server: on BlockOnce timeout, fall back to non-blocking Read

Frontends rely on getting the current state on timeout (heartbeat).
When BlockOnce returns empty (5s timeout), the server now calls the
plain Read handler as fallback. Files without a Read handler (like
feed) return nothing — consumer unaffected.
This commit is contained in:
Levi Neely 2026-08-13 20:59:05 +02:00
parent dd0021fd9a
commit bcaac146d2
1 changed files with 4 additions and 0 deletions

View File

@ -500,6 +500,10 @@ func read(root *fs.Tree, cs *connState, fc *plan9.Fcall, ctx context.Context) *p
if err != nil {
return errFcall(fc, err.Error())
}
if len(content) == 0 {
// Timeout: fall back to non-blocking Read for current value.
content, _ = entry.Read()
}
if nextBase != "" {
cs.mu.Lock()
if f, ok := cs.fids[fc.Fid]; ok {