Skip to content

Commit

Permalink
planner: fix DATA RACE caused by TestCaptureWildcardFilter (#49092)
Browse files Browse the repository at this point in the history
close #49088
  • Loading branch information
qw4990 authored Dec 1, 2023
1 parent 3093057 commit a6046a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/bindinfo/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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
2 changes: 1 addition & 1 deletion pkg/bindinfo/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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

0 comments on commit a6046a0

Please sign in to comment.