Skip to content

Commit

Permalink
planner: fix DATA RACE caused by TestCaptureWildcardFilter (#49092) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Feb 20, 2024
1 parent 1dae341 commit 75b2e1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/bindinfo/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import (

// BindHandle is used to handle all global sql bind operations.
type BindHandle struct {
sctx struct {
sctx struct { // TODO: remove this singleton sctx later on, which is not thread-safe.
sync.Mutex
sessionctx.Context
}
Expand Down Expand Up @@ -842,6 +842,8 @@ func ParseCaptureTableFilter(tableFilter string) (f tablefilter.Filter, valid bo
}

func (h *BindHandle) extractCaptureFilterFromStorage() (filter *captureFilter) {
h.sctx.Lock()
defer h.sctx.Unlock()
filter = &captureFilter{
frequency: 1,
users: make(map[string]struct{}),
Expand Down

0 comments on commit 75b2e1f

Please sign in to comment.