From 38f276b9fec24b38ad9c79babfa465910d0d8fc9 Mon Sep 17 00:00:00 2001 From: Dong Jianhui <978007503@qq.com> Date: Tue, 27 Jul 2021 23:27:52 +0800 Subject: [PATCH 1/5] feat(getty): upgrade getty version to 1.4.4 --- go.mod | 2 +- go.sum | 4 ++++ registry/etcdv3/listener_test.go | 4 ++-- registry/kubernetes/registry.go | 4 ++-- remoting/getty/getty_client.go | 3 ++- remoting/getty/listener.go | 3 ++- remoting/getty/readwriter.go | 8 -------- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 7bfbb6f5c6..c09d36f104 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Workiva/go-datastructures v1.0.52 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alibaba/sentinel-golang v1.0.2 - github.com/apache/dubbo-getty v1.4.3 + github.com/apache/dubbo-getty v1.4.4 github.com/apache/dubbo-go-hessian2 v1.9.2 github.com/creasty/defaults v1.5.1 github.com/dubbogo/go-zookeeper v1.0.3 diff --git a/go.sum b/go.sum index e511abf4e2..c710588a30 100644 --- a/go.sum +++ b/go.sum @@ -55,6 +55,8 @@ github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDH github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/dubbo-getty v1.4.3 h1:PCKpryDasKOxwT5MBC6MIMO+0NLOaHF6Xco9YXQw7HI= github.com/apache/dubbo-getty v1.4.3/go.mod h1:ansXgKxxyhCOiQL29nO5ce1MDcEKmCyZuNR9oMs3hek= +github.com/apache/dubbo-getty v1.4.4 h1:pthYQaCXyjHJ6/SjVwKkX5NhdAqSpUrRL1Z9GowrLdE= +github.com/apache/dubbo-getty v1.4.4/go.mod h1:mcDyiu7M/TVrYDyL8TxDemQkOdvEqqHSQ4jOuYejY1w= github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= github.com/apache/dubbo-go-hessian2 v1.9.2 h1:XuI8KvENSfKiAhiCBS4RNihmQDoPNmGWKT3gTui0p9A= github.com/apache/dubbo-go-hessian2 v1.9.2/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= @@ -149,6 +151,7 @@ github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl8 github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI= +github.com/dubbogo/gost v1.11.12/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/gost v1.11.14 h1:9lfcdILOmqTOVAW1fPHa5uf1NrD6jlIOBe4vf8576yQ= github.com/dubbogo/gost v1.11.14/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/jsonparser v1.0.1/go.mod h1:tYAtpctvSP/tWw4MeelsowSPgXQRVHHWbqL6ynps8jU= @@ -468,6 +471,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= diff --git a/registry/etcdv3/listener_test.go b/registry/etcdv3/listener_test.go index d9853b5c4f..1b3e3aea08 100644 --- a/registry/etcdv3/listener_test.go +++ b/registry/etcdv3/listener_test.go @@ -18,13 +18,13 @@ package etcdv3 import ( + gxtime "github.com/dubbogo/gost/time" "os" "testing" "time" ) import ( - getty "github.com/apache/dubbo-getty" "github.com/stretchr/testify/suite" "go.etcd.io/etcd/server/v3/embed" ) @@ -57,7 +57,7 @@ func (suite *RegistryTestSuite) SetupSuite() { select { case <-e.Server.ReadyNotify(): t.Log("Server is ready!") - case <-getty.GetTimeWheel().After(60 * time.Second): + case <-gxtime.After(60 * time.Second): e.Server.Stop() // trigger a shutdown t.Logf("Server took too long to start!") } diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go index 239644e327..c91001fea1 100644 --- a/registry/kubernetes/registry.go +++ b/registry/kubernetes/registry.go @@ -25,7 +25,7 @@ import ( ) import ( - getty "github.com/apache/dubbo-getty" + gxtime "github.com/dubbogo/gost/time" perrors "github.com/pkg/errors" v1 "k8s.io/api/core/v1" ) @@ -210,7 +210,7 @@ LOOP: // try to connect to kubernetes, failTimes = 0 for { - after := getty.GetTimeWheel().After(timeSecondDuration(failTimes * ConnDelay)) + after := gxtime.After(timeSecondDuration(failTimes * ConnDelay)) select { case <-r.Done(): logger.Warnf("(KubernetesProviderRegistry)reconnectKubernetes Registry goroutine exit now...") diff --git a/remoting/getty/getty_client.go b/remoting/getty/getty_client.go index cbe8245eb3..77092a447b 100644 --- a/remoting/getty/getty_client.go +++ b/remoting/getty/getty_client.go @@ -18,6 +18,7 @@ package getty import ( + gxtime "github.com/dubbogo/gost/time" "math/rand" "sync" "time" @@ -201,7 +202,7 @@ func (c *Client) Request(request *remoting.Request, timeout time.Duration, respo } select { - case <-getty.GetTimeWheel().After(timeout): + case <-gxtime.After(timeout): return perrors.WithStack(errClientReadTimeout) case <-response.Done: err = response.Err diff --git a/remoting/getty/listener.go b/remoting/getty/listener.go index 68275bb649..96a7b46874 100644 --- a/remoting/getty/listener.go +++ b/remoting/getty/listener.go @@ -19,6 +19,7 @@ package getty import ( "fmt" + gxtime "github.com/dubbogo/gost/time" "sync" "sync/atomic" "time" @@ -378,7 +379,7 @@ func heartbeat(session getty.Session, timeout time.Duration, callBack func(err e go func() { var err1 error select { - case <-getty.GetTimeWheel().After(timeout): + case <-gxtime.After(timeout): err1 = errHeartbeatReadTimeout case <-resp.Done: err1 = resp.Err diff --git a/remoting/getty/readwriter.go b/remoting/getty/readwriter.go index 9ba96b283f..9910815b88 100644 --- a/remoting/getty/readwriter.go +++ b/remoting/getty/readwriter.go @@ -87,14 +87,6 @@ func (p *RpcClientPackageHandler) Write(ss getty.Session, pkg interface{}) ([]by return nil, perrors.New("invalid rpc request") } -//////////////////////////////////////////// -// RpcServerPackageHandler -//////////////////////////////////////////// - -//var ( -// rpcServerPkgHandler = &RpcServerPackageHandler{} -//) - // RpcServerPackageHandler Read data from client and Write data to client type RpcServerPackageHandler struct { server *Server From 4b8c0b12ef7b8ae1dfcf42a9c46d39a83d7c9771 Mon Sep 17 00:00:00 2001 From: Dong Jianhui <978007503@qq.com> Date: Thu, 29 Jul 2021 00:28:26 +0800 Subject: [PATCH 2/5] feat(getty): delete outdated getty params --- config/testdata/consumer_config.yml | 1 - config/testdata/consumer_config_with_configcenter.yml | 1 - config/testdata/consumer_config_withoutProtocol.yml | 1 - config/testdata/provider_config.yml | 1 - config/testdata/provider_config_withoutProtocol.yml | 1 - config_center/apollo/impl_test.go | 1 - metadata/service/exporter/configurable/exporter_test.go | 1 - protocol/dubbo/dubbo_invoker_test.go | 2 -- protocol/dubbo/dubbo_protocol_test.go | 2 -- remoting/getty/config.go | 3 --- remoting/getty/getty_client_test.go | 2 -- remoting/getty/readwriter_test.go | 2 -- test/integrate/dubbo/go-client/client.yml | 2 -- test/integrate/dubbo/go-server/server.yml | 2 -- 14 files changed, 22 deletions(-) diff --git a/config/testdata/consumer_config.yml b/config/testdata/consumer_config.yml index 2034186c0f..c011c9e40b 100644 --- a/config/testdata/consumer_config.yml +++ b/config/testdata/consumer_config.yml @@ -87,7 +87,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/config/testdata/consumer_config_with_configcenter.yml b/config/testdata/consumer_config_with_configcenter.yml index 89869dcff5..fe979dacd4 100644 --- a/config/testdata/consumer_config_with_configcenter.yml +++ b/config/testdata/consumer_config_with_configcenter.yml @@ -36,7 +36,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/config/testdata/consumer_config_withoutProtocol.yml b/config/testdata/consumer_config_withoutProtocol.yml index f3d9265442..6028a48db4 100644 --- a/config/testdata/consumer_config_withoutProtocol.yml +++ b/config/testdata/consumer_config_withoutProtocol.yml @@ -73,7 +73,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/config/testdata/provider_config.yml b/config/testdata/provider_config.yml index de22b79d72..3c081c0168 100644 --- a/config/testdata/provider_config.yml +++ b/config/testdata/provider_config.yml @@ -92,7 +92,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/config/testdata/provider_config_withoutProtocol.yml b/config/testdata/provider_config_withoutProtocol.yml index 3fa8100d84..651c2f4c6a 100644 --- a/config/testdata/provider_config_withoutProtocol.yml +++ b/config/testdata/provider_config_withoutProtocol.yml @@ -72,7 +72,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/config_center/apollo/impl_test.go b/config_center/apollo/impl_test.go index 3392868223..43c6abaf17 100644 --- a/config_center/apollo/impl_test.go +++ b/config_center/apollo/impl_test.go @@ -110,7 +110,6 @@ var mockConfigRes = `{ "application.environment": "dev", "services.UserProvider.protocol": "dubbo", "application.organization": "ikurento.com", - "protocol_conf.dubbo.getty_session_param.pkg_wq_size": "512", "services.UserProvider.methods[0].loadbalance": "random" }, "releaseKey": "20191104105242-0f13805d89f834a4" diff --git a/metadata/service/exporter/configurable/exporter_test.go b/metadata/service/exporter/configurable/exporter_test.go index 3ae67500ff..34dc20d969 100644 --- a/metadata/service/exporter/configurable/exporter_test.go +++ b/metadata/service/exporter/configurable/exporter_test.go @@ -46,7 +46,6 @@ func TestConfigurableExporter(t *testing.T) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/protocol/dubbo/dubbo_invoker_test.go b/protocol/dubbo/dubbo_invoker_test.go index 901547f91f..97a7cdaa9d 100644 --- a/protocol/dubbo/dubbo_invoker_test.go +++ b/protocol/dubbo/dubbo_invoker_test.go @@ -112,7 +112,6 @@ func InitTest(t *testing.T) (protocol.Protocol, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "4s", TcpWriteTimeout: "5s", WaitTimeout: "1s", @@ -130,7 +129,6 @@ func InitTest(t *testing.T) (protocol.Protocol, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/protocol/dubbo/dubbo_protocol_test.go b/protocol/dubbo/dubbo_protocol_test.go index 72f5b11682..30e985e9a0 100644 --- a/protocol/dubbo/dubbo_protocol_test.go +++ b/protocol/dubbo/dubbo_protocol_test.go @@ -52,7 +52,6 @@ func initDubboInvokerTest() { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", @@ -71,7 +70,6 @@ func initDubboInvokerTest() { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "4s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/remoting/getty/config.go b/remoting/getty/config.go index bd56291b38..05713c7a7c 100644 --- a/remoting/getty/config.go +++ b/remoting/getty/config.go @@ -39,7 +39,6 @@ type ( keepAlivePeriod time.Duration TcpRBufSize int `default:"262144" yaml:"tcp_r_buf_size" json:"tcp_r_buf_size,omitempty"` TcpWBufSize int `default:"65536" yaml:"tcp_w_buf_size" json:"tcp_w_buf_size,omitempty"` - PkgWQSize int `default:"1024" yaml:"pkg_wq_size" json:"pkg_wq_size,omitempty"` TcpReadTimeout string `default:"1s" yaml:"tcp_read_timeout" json:"tcp_read_timeout,omitempty"` tcpReadTimeout time.Duration TcpWriteTimeout string `default:"5s" yaml:"tcp_write_timeout" json:"tcp_write_timeout,omitempty"` @@ -122,7 +121,6 @@ func GetDefaultClientConfig() ClientConfig { KeepAlivePeriod: "180s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", @@ -147,7 +145,6 @@ func GetDefaultServerConfig() ServerConfig { KeepAlivePeriod: "180s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index a5b26ba3af..e14b3ee5d9 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -343,7 +343,6 @@ func InitTest(t *testing.T) (*Server, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "4s", TcpWriteTimeout: "5s", WaitTimeout: "1s", @@ -362,7 +361,6 @@ func InitTest(t *testing.T) (*Server, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/remoting/getty/readwriter_test.go b/remoting/getty/readwriter_test.go index b1687e81ce..657a8d6f00 100644 --- a/remoting/getty/readwriter_test.go +++ b/remoting/getty/readwriter_test.go @@ -98,7 +98,6 @@ func getServer(t *testing.T) (*Server, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "4s", TcpWriteTimeout: "5s", WaitTimeout: "1s", @@ -117,7 +116,6 @@ func getServer(t *testing.T) (*Server, *common.URL) { KeepAlivePeriod: "120s", TcpRBufSize: 262144, TcpWBufSize: 65536, - PkgWQSize: 512, TcpReadTimeout: "1s", TcpWriteTimeout: "5s", WaitTimeout: "1s", diff --git a/test/integrate/dubbo/go-client/client.yml b/test/integrate/dubbo/go-client/client.yml index 93625d8020..8f17b6b88f 100644 --- a/test/integrate/dubbo/go-client/client.yml +++ b/test/integrate/dubbo/go-client/client.yml @@ -52,8 +52,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_rq_size: 1024 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" diff --git a/test/integrate/dubbo/go-server/server.yml b/test/integrate/dubbo/go-server/server.yml index ff57a7d602..aa519ccb05 100644 --- a/test/integrate/dubbo/go-server/server.yml +++ b/test/integrate/dubbo/go-server/server.yml @@ -48,8 +48,6 @@ protocol_conf: keep_alive_period: "120s" tcp_r_buf_size: 262144 tcp_w_buf_size: 65536 - pkg_rq_size: 1024 - pkg_wq_size: 512 tcp_read_timeout: "1s" tcp_write_timeout: "5s" wait_timeout: "1s" From 189a54a254c7ca5e7a6bb856ad93338f71f167ba Mon Sep 17 00:00:00 2001 From: dongjianhui03 Date: Sun, 8 Aug 2021 23:22:02 +0800 Subject: [PATCH 3/5] delete time.Sleep in unit test --- remoting/getty/getty_client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index e14b3ee5d9..5316fed22c 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -435,7 +435,7 @@ func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User func (u *UserProvider) GetUser0(id string, k *User, name string) (User, error) { // fix testClient_AsyncCall assertion bug(#1233) - time.Sleep(1 * time.Second) + //time.Sleep(1 * time.Second) return User{ID: id, Name: name}, nil } From f9237b0d838df17dd7074ea014a4587633295b6f Mon Sep 17 00:00:00 2001 From: dongjianhui03 Date: Wed, 11 Aug 2021 23:10:26 +0800 Subject: [PATCH 4/5] upgrade getty version to 1.4.5 --- go.mod | 2 +- go.sum | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c09d36f104..449adaedc8 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Workiva/go-datastructures v1.0.52 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alibaba/sentinel-golang v1.0.2 - github.com/apache/dubbo-getty v1.4.4 + github.com/apache/dubbo-getty v1.4.5 github.com/apache/dubbo-go-hessian2 v1.9.2 github.com/creasty/defaults v1.5.1 github.com/dubbogo/go-zookeeper v1.0.3 diff --git a/go.sum b/go.sum index c710588a30..d9bd4ac753 100644 --- a/go.sum +++ b/go.sum @@ -57,6 +57,8 @@ github.com/apache/dubbo-getty v1.4.3 h1:PCKpryDasKOxwT5MBC6MIMO+0NLOaHF6Xco9YXQw github.com/apache/dubbo-getty v1.4.3/go.mod h1:ansXgKxxyhCOiQL29nO5ce1MDcEKmCyZuNR9oMs3hek= github.com/apache/dubbo-getty v1.4.4 h1:pthYQaCXyjHJ6/SjVwKkX5NhdAqSpUrRL1Z9GowrLdE= github.com/apache/dubbo-getty v1.4.4/go.mod h1:mcDyiu7M/TVrYDyL8TxDemQkOdvEqqHSQ4jOuYejY1w= +github.com/apache/dubbo-getty v1.4.5 h1:MptKbjC0n2Mo/8eFPwirSInH2BfdNG4IZch43PdNvIM= +github.com/apache/dubbo-getty v1.4.5/go.mod h1:mcDyiu7M/TVrYDyL8TxDemQkOdvEqqHSQ4jOuYejY1w= github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= github.com/apache/dubbo-go-hessian2 v1.9.2 h1:XuI8KvENSfKiAhiCBS4RNihmQDoPNmGWKT3gTui0p9A= github.com/apache/dubbo-go-hessian2 v1.9.2/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= @@ -470,8 +472,8 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= From ade5a1f4a8207557b42b6d7f86c2ea9b7c100500 Mon Sep 17 00:00:00 2001 From: dongjianhui03 Date: Fri, 13 Aug 2021 13:39:50 +0800 Subject: [PATCH 5/5] style(getty): format package getty imports --- go.sum | 7 ------- registry/etcdv3/listener.go | 1 + registry/etcdv3/listener_test.go | 4 +++- registry/etcdv3/registry.go | 1 + registry/etcdv3/service_discovery.go | 2 ++ registry/kubernetes/listener.go | 1 + registry/kubernetes/registry.go | 2 ++ registry/kubernetes/registry_test.go | 1 + remoting/getty/dubbo_codec_for_test.go | 1 + remoting/getty/getty_client.go | 6 +++++- remoting/getty/getty_client_test.go | 4 +++- remoting/getty/getty_server.go | 3 +++ remoting/getty/listener.go | 5 ++++- remoting/getty/listener_test.go | 1 + remoting/getty/pool.go | 1 + remoting/getty/readwriter.go | 2 ++ remoting/getty/readwriter_test.go | 1 + 17 files changed, 32 insertions(+), 11 deletions(-) diff --git a/go.sum b/go.sum index d9bd4ac753..333e8b82ca 100644 --- a/go.sum +++ b/go.sum @@ -53,10 +53,6 @@ github.com/alibaba/sentinel-golang v1.0.2/go.mod h1:QsB99f/z35D2AiMrAWwgWE85kDTk github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/apache/dubbo-getty v1.4.3 h1:PCKpryDasKOxwT5MBC6MIMO+0NLOaHF6Xco9YXQw7HI= -github.com/apache/dubbo-getty v1.4.3/go.mod h1:ansXgKxxyhCOiQL29nO5ce1MDcEKmCyZuNR9oMs3hek= -github.com/apache/dubbo-getty v1.4.4 h1:pthYQaCXyjHJ6/SjVwKkX5NhdAqSpUrRL1Z9GowrLdE= -github.com/apache/dubbo-getty v1.4.4/go.mod h1:mcDyiu7M/TVrYDyL8TxDemQkOdvEqqHSQ4jOuYejY1w= github.com/apache/dubbo-getty v1.4.5 h1:MptKbjC0n2Mo/8eFPwirSInH2BfdNG4IZch43PdNvIM= github.com/apache/dubbo-getty v1.4.5/go.mod h1:mcDyiu7M/TVrYDyL8TxDemQkOdvEqqHSQ4jOuYejY1w= github.com/apache/dubbo-go-hessian2 v1.9.1/go.mod h1:xQUjE7F8PX49nm80kChFvepA/AvqAZ0oh/UaB6+6pBE= @@ -152,7 +148,6 @@ github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZ github.com/dubbogo/go-zookeeper v1.0.3 h1:UkuY+rBsxdT7Bs63QAzp9z7XqQ53W1j8E5rwl83me8g= github.com/dubbogo/go-zookeeper v1.0.3/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0/go.mod h1:pPTjVyoJan3aPxBPNUX0ADkXjPibLo+/Ib0/fADXSG8= -github.com/dubbogo/gost v1.10.1/go.mod h1:+mQGS51XQEUWZP2JeGZTxJwipjRKtJO7Tr+FOg+72rI= github.com/dubbogo/gost v1.11.12/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= github.com/dubbogo/gost v1.11.14 h1:9lfcdILOmqTOVAW1fPHa5uf1NrD6jlIOBe4vf8576yQ= github.com/dubbogo/gost v1.11.14/go.mod h1:vIcP9rqz2KsXHPjsAwIUtfJIJjppQLQDcYaZTy/61jI= @@ -601,7 +596,6 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil v3.20.11-0.20201116082039-2fb5da2f2449+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.20.11+incompatible h1:LJr4ZQK4mPpIV5gOa4jCOKOGb4ty4DZO54I4FGqIpto= github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -653,7 +647,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= diff --git a/registry/etcdv3/listener.go b/registry/etcdv3/listener.go index bc290aecca..92e55aa093 100644 --- a/registry/etcdv3/listener.go +++ b/registry/etcdv3/listener.go @@ -24,6 +24,7 @@ import ( import ( gxchan "github.com/dubbogo/gost/container/chan" + perrors "github.com/pkg/errors" ) diff --git a/registry/etcdv3/listener_test.go b/registry/etcdv3/listener_test.go index 1b3e3aea08..97f95e0f47 100644 --- a/registry/etcdv3/listener_test.go +++ b/registry/etcdv3/listener_test.go @@ -18,14 +18,16 @@ package etcdv3 import ( - gxtime "github.com/dubbogo/gost/time" "os" "testing" "time" ) import ( + gxtime "github.com/dubbogo/gost/time" + "github.com/stretchr/testify/suite" + "go.etcd.io/etcd/server/v3/embed" ) diff --git a/registry/etcdv3/registry.go b/registry/etcdv3/registry.go index b6e4a15252..3ab9a2e86a 100644 --- a/registry/etcdv3/registry.go +++ b/registry/etcdv3/registry.go @@ -27,6 +27,7 @@ import ( import ( gxetcd "github.com/dubbogo/gost/database/kv/etcd/v3" + perrors "github.com/pkg/errors" ) diff --git a/registry/etcdv3/service_discovery.go b/registry/etcdv3/service_discovery.go index c90633d165..85679f25cd 100644 --- a/registry/etcdv3/service_discovery.go +++ b/registry/etcdv3/service_discovery.go @@ -28,7 +28,9 @@ import ( gxset "github.com/dubbogo/gost/container/set" gxetcd "github.com/dubbogo/gost/database/kv/etcd/v3" gxpage "github.com/dubbogo/gost/hash/page" + "github.com/hashicorp/vault/sdk/helper/jsonutil" + perrors "github.com/pkg/errors" ) diff --git a/registry/kubernetes/listener.go b/registry/kubernetes/listener.go index c02c07a84b..7605235686 100644 --- a/registry/kubernetes/listener.go +++ b/registry/kubernetes/listener.go @@ -23,6 +23,7 @@ import ( import ( gxchan "github.com/dubbogo/gost/container/chan" + perrors "github.com/pkg/errors" ) diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go index c91001fea1..b6e110780c 100644 --- a/registry/kubernetes/registry.go +++ b/registry/kubernetes/registry.go @@ -26,7 +26,9 @@ import ( import ( gxtime "github.com/dubbogo/gost/time" + perrors "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" ) diff --git a/registry/kubernetes/registry_test.go b/registry/kubernetes/registry_test.go index 4ebb625e01..f217048cf4 100644 --- a/registry/kubernetes/registry_test.go +++ b/registry/kubernetes/registry_test.go @@ -28,6 +28,7 @@ import ( import ( "github.com/stretchr/testify/assert" + v1 "k8s.io/api/core/v1" ) diff --git a/remoting/getty/dubbo_codec_for_test.go b/remoting/getty/dubbo_codec_for_test.go index 572908b437..b7bd064f68 100644 --- a/remoting/getty/dubbo_codec_for_test.go +++ b/remoting/getty/dubbo_codec_for_test.go @@ -26,6 +26,7 @@ import ( import ( hessian "github.com/apache/dubbo-go-hessian2" + perrors "github.com/pkg/errors" ) diff --git a/remoting/getty/getty_client.go b/remoting/getty/getty_client.go index 77092a447b..c1d09d563a 100644 --- a/remoting/getty/getty_client.go +++ b/remoting/getty/getty_client.go @@ -18,7 +18,6 @@ package getty import ( - gxtime "github.com/dubbogo/gost/time" "math/rand" "sync" "time" @@ -26,9 +25,14 @@ import ( import ( "github.com/apache/dubbo-getty" + gxsync "github.com/dubbogo/gost/sync" + gxtime "github.com/dubbogo/gost/time" + perrors "github.com/pkg/errors" + "go.uber.org/atomic" + "gopkg.in/yaml.v2" ) diff --git a/remoting/getty/getty_client_test.go b/remoting/getty/getty_client_test.go index 5316fed22c..275649e6d9 100644 --- a/remoting/getty/getty_client_test.go +++ b/remoting/getty/getty_client_test.go @@ -28,7 +28,9 @@ import ( import ( hessian "github.com/apache/dubbo-go-hessian2" + perrors "github.com/pkg/errors" + "github.com/stretchr/testify/assert" ) @@ -435,7 +437,7 @@ func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User func (u *UserProvider) GetUser0(id string, k *User, name string) (User, error) { // fix testClient_AsyncCall assertion bug(#1233) - //time.Sleep(1 * time.Second) + time.Sleep(1 * time.Second) return User{ID: id, Name: name}, nil } diff --git a/remoting/getty/getty_server.go b/remoting/getty/getty_server.go index 9be3e055ad..ca6bd8a072 100644 --- a/remoting/getty/getty_server.go +++ b/remoting/getty/getty_server.go @@ -25,8 +25,11 @@ import ( import ( "github.com/apache/dubbo-getty" + gxsync "github.com/dubbogo/gost/sync" + perrors "github.com/pkg/errors" + "gopkg.in/yaml.v2" ) diff --git a/remoting/getty/listener.go b/remoting/getty/listener.go index 96a7b46874..622d5575c2 100644 --- a/remoting/getty/listener.go +++ b/remoting/getty/listener.go @@ -19,7 +19,6 @@ package getty import ( "fmt" - gxtime "github.com/dubbogo/gost/time" "sync" "sync/atomic" "time" @@ -27,7 +26,11 @@ import ( import ( "github.com/apache/dubbo-getty" + hessian "github.com/apache/dubbo-go-hessian2" + + gxtime "github.com/dubbogo/gost/time" + perrors "github.com/pkg/errors" ) diff --git a/remoting/getty/listener_test.go b/remoting/getty/listener_test.go index 407255e4b4..6d22e37dd0 100644 --- a/remoting/getty/listener_test.go +++ b/remoting/getty/listener_test.go @@ -25,6 +25,7 @@ import ( import ( "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/mocktracer" + "github.com/stretchr/testify/assert" ) diff --git a/remoting/getty/pool.go b/remoting/getty/pool.go index 7fc9eb813a..8b091a48bb 100644 --- a/remoting/getty/pool.go +++ b/remoting/getty/pool.go @@ -29,6 +29,7 @@ import ( import ( "github.com/apache/dubbo-getty" + perrors "github.com/pkg/errors" ) diff --git a/remoting/getty/readwriter.go b/remoting/getty/readwriter.go index 9910815b88..c78f354d65 100644 --- a/remoting/getty/readwriter.go +++ b/remoting/getty/readwriter.go @@ -24,7 +24,9 @@ import ( import ( "github.com/apache/dubbo-getty" + hessian "github.com/apache/dubbo-go-hessian2" + perrors "github.com/pkg/errors" ) diff --git a/remoting/getty/readwriter_test.go b/remoting/getty/readwriter_test.go index 657a8d6f00..e9be67dca1 100644 --- a/remoting/getty/readwriter_test.go +++ b/remoting/getty/readwriter_test.go @@ -25,6 +25,7 @@ import ( import ( hessian "github.com/apache/dubbo-go-hessian2" + "github.com/stretchr/testify/assert" )