Skip to content

Commit

Permalink
api(ticdc): fix resign owner cause capture restart bug (#10782) (#10816)
Browse files Browse the repository at this point in the history
close #10781
  • Loading branch information
ti-chi-bot authored Mar 20, 2024
1 parent 7d72d31 commit 3029b0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cdc/capture/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ func (c *captureImpl) campaignOwner(ctx cdcContext.Context) error {
})

g, ctx := errgroup.WithContext(ctx)
ctx, cancelOwner := context.WithCancel(ctx)
ownerCtx := cdcContext.NewContext(ctx, newGlobalVars)
g.Go(func() error {
return c.runEtcdWorker(ownerCtx, owner,
Expand All @@ -522,8 +521,8 @@ func (c *captureImpl) campaignOwner(ctx cdcContext.Context) error {
globalState,
// todo: do not use owner flush interval
ownerFlushInterval, util.RoleController.String())
// controller is exited, cancel owner to exit the loop.
cancelOwner()
// controller has exited, stop owner.
c.owner.AsyncStop()
return er
})
err = g.Wait()
Expand Down

0 comments on commit 3029b0d

Please sign in to comment.