New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retry for dialPumpClient #4879
Conversation
tidb.go
Outdated
@@ -232,7 +231,8 @@ func RegisterLocalStore(name string, driver engine.Driver) error { | |||
// | |||
// The engine should be registered before creating storage. | |||
func NewStore(path string) (kv.Storage, error) { | |||
return newStoreWithRetry(path, defaultMaxRetries) | |||
return newStoreWithRetry(path, 3) | |||
//return newStoreWithRetry(path, util.DefaultMaxRetries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong commit here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
tidb_test.go
Outdated
c.Assert(err, NotNil) | ||
c.Assert(err.Error(), Equals, "must fail") | ||
elapse := time.Since(begin) | ||
c.Assert(uint64(elapse), GreaterEqual, uint64(3*time.Second)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a smaller wait time for the test?
Please fix CI and conflict |
Conflicts: tidb-server/main.go
PTAL @coocood |
LGTM |
PTAL @shenli |
tidb_test.go
Outdated
func (s *testMainSuite) TestRetryDialPumpClient(c *C) { | ||
retryDialPumlClientMustFail := func(binlogSocket string, clientCon *grpc.ClientConn, maxRetries int, dialerOpt grpc.DialOption) (err error) { | ||
return util.RunWithRetry(maxRetries, 10, func() (bool, error) { | ||
clientCon, err = grpc.Dial(binlogSocket, grpc.WithInsecure(), dialerOpt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code doesn't use. We can remove it or add some comments.
@@ -248,13 +247,30 @@ func newStoreWithRetry(path string, maxRetries int) (kv.Storage, error) { | |||
} | |||
|
|||
var s kv.Storage | |||
err1 := util.RunWithRetry(maxRetries, retryInterval, func() (bool, error) { | |||
err1 := util.RunWithRetry(maxRetries, util.RetryInterval, func() (bool, error) { | |||
log.Infof("new store") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we log this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For recording this process.
tidb.go
Outdated
return util.RunWithRetry(maxRetries, util.RetryInterval, func() (bool, error) { | ||
log.Infof("setup binlog client") | ||
var err error | ||
clientCon, err = grpc.Dial(binlogSocket, grpc.WithInsecure(), dialerOpt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should log something if meet this error.
�ý,�ý.�ý`�ý,�ý.�ý,�ý.:q!
LGTM |
/run-all-tests |
fix #4848
PTAL @coocood