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:
parent
dd0021fd9a
commit
bcaac146d2
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue