Skip to content

Commit

Permalink
add the config to control the deadlock detection
Browse files Browse the repository at this point in the history
Signed-off-by: SimFG <bang.fu@zilliz.com>
  • Loading branch information
SimFG committed Aug 12, 2024
1 parent a0e76f9 commit 717e9a9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/milvus-io/milvus/pkg v0.0.2-0.20240712081735-d8e68cbb973d
github.com/prometheus/client_golang v1.14.0
github.com/samber/lo v1.27.0
github.com/sasha-s/go-deadlock v0.3.1
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c
github.com/stretchr/testify v1.8.4
go.etcd.io/etcd/client/v3 v3.5.5
go.uber.org/zap v1.21.0
Expand Down
4 changes: 2 additions & 2 deletions core/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
github.com/samber/lo v1.27.0 h1:GOyDWxsblvqYobqsmUuMddPa2/mMzkKyojlXol4+LaQ=
github.com/samber/lo v1.27.0/go.mod h1:it33p9UtPMS7z72fP4gw/EIfQB2eI8ke7GR2wc6+Rhg=
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c h1:rCY9BXit3Ody7aRFkT+q/OOGvNk9TVG2une4Xgemid4=
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
1 change: 1 addition & 0 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type CDCServerConfig struct {
MaxNameLength int
Retry config.RetrySettings
LogLevel string
DetectDeadLock bool
}

type CDCMetaStoreConfig struct {
Expand Down
1 change: 1 addition & 0 deletions server/configs/cdc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ sourceConfig:
# address: 127.0.0.1:9092
maxNameLength: 256
logLevel: info
detectDeadLock: false
4 changes: 2 additions & 2 deletions server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ require (
github.com/pingcap/log v1.1.1-0.20221015072633-39906604fb81
github.com/prometheus/client_golang v1.14.0
github.com/samber/lo v1.27.0
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c
github.com/stretchr/testify v1.8.4
github.com/zilliztech/milvus-cdc/core v0.0.1
go.etcd.io/etcd/client/v3 v3.5.5
go.uber.org/atomic v1.10.0
go.uber.org/zap v1.21.0
google.golang.org/grpc v1.57.1
sigs.k8s.io/yaml v1.3.0
Expand Down Expand Up @@ -96,7 +98,6 @@ require (
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/shirou/gopsutil/v3 v3.22.9 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/soheilhy/cmux v0.1.5 // indirect
Expand Down Expand Up @@ -136,7 +137,6 @@ require (
go.opentelemetry.io/otel/sdk v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo
github.com/samber/lo v1.27.0 h1:GOyDWxsblvqYobqsmUuMddPa2/mMzkKyojlXol4+LaQ=
github.com/samber/lo v1.27.0/go.mod h1:it33p9UtPMS7z72fP4gw/EIfQB2eI8ke7GR2wc6+Rhg=
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c h1:rCY9BXit3Ody7aRFkT+q/OOGvNk9TVG2une4Xgemid4=
github.com/sasha-s/go-deadlock v0.3.2-0.20240530143741-ed6f7f6d979c/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
2 changes: 2 additions & 0 deletions server/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main
import (
"os"

"github.com/sasha-s/go-deadlock"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"sigs.k8s.io/yaml"
Expand Down Expand Up @@ -53,5 +54,6 @@ func main() {
logLevel = zap.InfoLevel
}
log.SetLevel(logLevel)
deadlock.Opts.Disable = !serverConfig.DetectDeadLock
s.Run(&serverConfig)
}

0 comments on commit 717e9a9

Please sign in to comment.