fs/session: statewait must use h.ag.WaitChange, not Core.WaitChange
Session.WaitChange delegates to a.Agent() (the active agent), so statewait was blocking on the WRONG agent's state changes. Agent.WaitChange uses per-agent changeCond, so it properly blocks until this specific agent's state actually changes.
This commit is contained in:
parent
3f61a8929a
commit
a7359fffcf
|
|
@ -367,7 +367,7 @@ func (h *agentHelper) fileSpec(name string, mode os.FileMode) FileSpec {
|
|||
if base == "" {
|
||||
base = h.ag.State()
|
||||
}
|
||||
v, ok := h.sess.Core.WaitChange(ctx, agent.WatchState, base)
|
||||
v, ok := h.ag.WaitChange(ctx, agent.WatchState, base)
|
||||
if !ok {
|
||||
s := h.ag.State()
|
||||
return []byte(s + "\n"), s, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue