Skip to content

Commit

Permalink
dual_selector: don't cancel reference context
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Feb 26, 2022
1 parent ea2d0e8 commit 2287bd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dispatcher/plugin/executable/dual_selector/dual_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ func (s *Selector) Exec(ctx context.Context, qCtx *handler.Context, next handler
if !ok {
ddl = time.Now().Add(defaultSubRoutineTimout)
}
ctxRef, cancelRef := context.WithDeadline(context.Background(), ddl)
defer cancelRef()

shouldBlock := make(chan struct{}, 0)
shouldPass := make(chan struct{}, 0)
ctxRef, cancelRef := context.WithDeadline(context.Background(), ddl)
go func() {
defer cancelRef()
err := handler.ExecChainNode(ctxRef, qCtxRef, next)
if err != nil {
s.L().Warn("reference query routine err", qCtxRef.InfoField(), zap.Error(err))
Expand Down

0 comments on commit 2287bd5

Please # to comment.