Skip to content

Commit b109407

Browse files
committed
continue fixing
1 parent 3a87171 commit b109407

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

coordinator/internal/controller/proxy/client_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (cliMgr *ClientManager) ClientAsProxy(ctx context.Context) ProxyCli {
155155
completionCtx = cliMgr.cachedCli.completionCtx
156156
} else {
157157
// Set new completion context and launch login goroutine
158-
ctx, completionDone := context.WithCancel(context.TODO())
158+
ctx, completionDone := context.WithCancel(context.Background())
159159
loginCli := newUpClient(cliMgr.cfg)
160160
loginCli.resetFromMgr = func() {
161161
cliMgr.cachedCli.Lock()

coordinator/internal/controller/proxy/prover_session.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,12 @@ func (c *proverSession) maintainLogin(ctx context.Context, cliMgr Client, up str
114114
waitctx := c.completionCtx
115115
c.Unlock()
116116
select {
117+
case <-waitctx.Done():
118+
return c.maintainLogin(ctx, cliMgr, up, param, phase)
117119
case <-ctx.Done():
118120
nerr = fmt.Errorf("ctx fail")
119121
return
120-
default:
121122
}
122-
<-waitctx.Done()
123-
return c.maintainLogin(ctx, cliMgr, up, param, phase)
124123
}
125124

126125
if phase < curPhase {
@@ -131,7 +130,7 @@ func (c *proverSession) maintainLogin(ctx context.Context, cliMgr Client, up str
131130
}
132131

133132
// occupy the update slot
134-
completeCtx, cf := context.WithCancel(ctx)
133+
completeCtx, cf := context.WithCancel(context.Background())
135134
defer cf()
136135
c.completionCtx = completeCtx
137136
defer func() {

0 commit comments

Comments
 (0)