Skip to content

Commit

Permalink
Merge branch 'master' into shardddlUTUpgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu authored Mar 15, 2022
2 parents f0974d6 + cf8f76b commit 81017d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dm/syncer/dml_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ func (w *DMLWorker) executeBatchJobs(queueID int, jobs []*job) {
time.Sleep(time.Duration(t) * time.Second)
})
// use background context to execute sqls as much as possible
ctx, cancel := w.syncCtx.WithTimeout(maxDMLExecutionDuration)
// set timeout to maxDMLConnectionDuration to make sure dmls can be replicated to downstream event if the latency is high
// if users need to quit this asap, we can support pause-task/stop-task --force in the future
ctx, cancel := w.syncCtx.WithTimeout(maxDMLConnectionDuration)
defer cancel()
affect, err = db.ExecuteSQL(ctx, queries, args...)
failpoint.Inject("SafeModeExit", func(val failpoint.Value) {
Expand Down
1 change: 0 additions & 1 deletion dm/syncer/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ var (
maxDDLConnectionTimeout = fmt.Sprintf("%dm", MaxDDLConnectionTimeoutMinute)

maxDMLConnectionDuration, _ = time.ParseDuration(maxDMLConnectionTimeout)
maxDMLExecutionDuration = 30 * time.Second

defaultMaxPauseOrStopWaitTime = 10 * time.Second

Expand Down

0 comments on commit 81017d7

Please sign in to comment.