Skip to content

Commit

Permalink
ddl: ignore internal http client goroutine in leak tests (#40190)
Browse files Browse the repository at this point in the history
close #40183
  • Loading branch information
tangenta authored Dec 27, 2022
1 parent afbef28 commit 32f9604
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -703,15 +703,18 @@ func pickBackfillType(w *worker, job *model.Job) model.ReorgType {
return job.ReorgMeta.ReorgTp
}
if IsEnableFastReorg() {
canUseIngest := canUseIngest(w)
if ingest.LitInitialized && canUseIngest {
job.ReorgMeta.ReorgTp = model.ReorgTypeLitMerge
return model.ReorgTypeLitMerge
var useIngest bool
if ingest.LitInitialized {
useIngest = canUseIngest(w)
if useIngest {
job.ReorgMeta.ReorgTp = model.ReorgTypeLitMerge
return model.ReorgTypeLitMerge
}
}
// The lightning environment is unavailable, but we can still use the txn-merge backfill.
logutil.BgLogger().Info("[ddl] fallback to txn-merge backfill process",
zap.Bool("lightning env initialized", ingest.LitInitialized),
zap.Bool("can use ingest", canUseIngest))
zap.Bool("can use ingest", useIngest))
job.ReorgMeta.ReorgTp = model.ReorgTypeTxnMerge
return model.ReorgTypeTxnMerge
}
Expand Down
2 changes: 2 additions & 0 deletions ddl/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func TestMain(m *testing.M) {
goleak.IgnoreTopFunction("go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop"),
goleak.IgnoreTopFunction("github.com/tikv/client-go/v2/txnkv/transaction.keepAlive"),
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"),
goleak.IgnoreTopFunction("internal/poll.runtime_pollWait"),
goleak.IgnoreTopFunction("net/http.(*persistConn).writeLoop"),
}

goleak.VerifyTestMain(m, opts...)
Expand Down

0 comments on commit 32f9604

Please sign in to comment.