Skip to content

Commit

Permalink
importinto: protect panic from encode loop (#56166)
Browse files Browse the repository at this point in the history
ref #55970
  • Loading branch information
D3Hunter authored Sep 20, 2024
1 parent 66d8cdc commit a807829
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/executor/importer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ go_library(
"@com_github_tikv_client_go_v2//util",
"@com_github_tikv_pd_client//:client",
"@io_etcd_go_etcd_client_v3//:client",
"@org_golang_x_sync//errgroup",
"@org_uber_go_multierr//:multierr",
"@org_uber_go_zap//:zap",
],
Expand Down
4 changes: 2 additions & 2 deletions pkg/executor/importer/chunk_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ import (
verify "github.com/pingcap/tidb/pkg/lightning/verification"
"github.com/pingcap/tidb/pkg/tablecodec"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util"
"github.com/pingcap/tidb/pkg/util/syncutil"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
)

// constants, make it a variable for test
Expand Down Expand Up @@ -337,7 +337,7 @@ func (p *baseChunkProcessor) Process(ctx context.Context) (err error) {
}
}()

group, gCtx := errgroup.WithContext(ctx)
group, gCtx := util.NewErrorGroupWithRecoverWithCtx(ctx)
group.Go(func() error {
return p.deliver.deliverLoop(gCtx)
})
Expand Down

0 comments on commit a807829

Please sign in to comment.