diff --git a/cmd/olliesrv/server.go b/cmd/olliesrv/server.go index 7620f61..56ca5e0 100644 --- a/cmd/olliesrv/server.go +++ b/cmd/olliesrv/server.go @@ -876,6 +876,10 @@ func (s *Server) read(cs *connState, fc *plan9.Fcall, ctx context.Context) *plan return errFcall(fc, err.Error()) } + if strings.HasSuffix(path, "/statewait") { + s.log.Debug("statewait read path=%q isBlocking=%v longBlock=%v oneShot=%v", path, entry.IsBlocking(), entry.LongBlock(), entry.OneShot()) + } + // OneShot entries yield data once per open; offset>0 means EOF. if entry.OneShot() && fc.Offset > 0 { return &plan9.Fcall{Type: plan9.Rread, Tag: fc.Tag, Count: 0} diff --git a/fs/session/files.go b/fs/session/files.go index 9feabfd..11774e7 100644 --- a/fs/session/files.go +++ b/fs/session/files.go @@ -367,14 +367,11 @@ func (h *agentHelper) fileSpec(name string, mode os.FileMode) FileSpec { if base == "" { base = h.ag.State() } - h.log.Debug("statewait: begin base=%q ag=%q", base, h.ag.Name()) v, ok := h.ag.WaitChange(ctx, agent.WatchState, base) if !ok { s := h.ag.State() - h.log.Debug("statewait: !ok returning state=%q", s) return []byte(s + "\n"), s, nil } - h.log.Debug("statewait: ok returning state=%q", v) return []byte(v + "\n"), v, nil } }