(dubbo-go) branch main updated: update imports.go (#2655)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 1f7eb1180 update imports.go (#2655) 1f7eb1180 is described below commit 1f7eb1180cd9864aa52003b9f9cb11e8549b9a86 Author: Ken Liu AuthorDate: Mon Apr 8 14:21:15 2024 +0800 update imports.go (#2655) * update imports.go * update imports.go --- imports/imports.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/imports/imports.go b/imports/imports.go index bb8845e3c..673085d50 100644 --- a/imports/imports.go +++ b/imports/imports.go @@ -29,7 +29,9 @@ import ( _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster/failsafe" _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster/forking" _ "dubbo.apache.org/dubbo-go/v3/cluster/cluster/zoneaware" + _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/aliasmethod" _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/consistenthashing" + _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/iwrr" _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/leastactive" _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/p2c" _ "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance/random"
(dubbo-go) branch main updated: Fix/sentinel filter (#2621)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 55a06394e Fix/sentinel filter (#2621) 55a06394e is described below commit 55a06394edb544cb0a54b8b697da3ae34b4f014c Author: 不插电 <69096367+r27153...@users.noreply.github.com> AuthorDate: Fri Mar 22 15:45:42 2024 +0800 Fix/sentinel filter (#2621) * fix: the bug of sentinel.TraceError and sentinel.Exit not being called, and sentinel.InitDefault() not being called * test: add test sentinel filter error count * fix: The problem of sentinel.TraceError not being called in sentinelConsumerFilter. * style: adjust code style. --- filter/sentinel/filter.go | 56 +++-- filter/sentinel/filter_test.go | 71 ++ 2 files changed, 103 insertions(+), 24 deletions(-) diff --git a/filter/sentinel/filter.go b/filter/sentinel/filter.go index 009e77dca..5b2d8cecd 100644 --- a/filter/sentinel/filter.go +++ b/filter/sentinel/filter.go @@ -52,6 +52,10 @@ func init() { } } +var ( + initOnce sync.Once +) + type DubboLoggerWrapper struct { logger.Logger } @@ -88,19 +92,6 @@ func (d DubboLoggerWrapper) ErrorEnabled() bool { return true } -func sentinelExit(ctx context.Context, result protocol.Result) { - if methodEntry := ctx.Value(MethodEntryKey); methodEntry != nil { - e := methodEntry.(*base.SentinelEntry) - sentinel.TraceError(e, result.Error()) - e.Exit() - } - if interfaceEntry := ctx.Value(InterfaceEntryKey); interfaceEntry != nil { - e := interfaceEntry.(*base.SentinelEntry) - sentinel.TraceError(e, result.Error()) - e.Exit() - } -} - var ( providerOnce sync.Once sentinelProvider *sentinelProviderFilter @@ -110,6 +101,11 @@ type sentinelProviderFilter struct{} func newSentinelProviderFilter() filter.Filter { if sentinelProvider == nil { + initOnce.Do(func() { + if err := sentinel.InitDefault(); err != nil { + panic(err) + } + }) providerOnce.Do(func() { sentinelProvider = &sentinelProviderFilter{} }) @@ -130,7 +126,7 @@ func (d *sentinelProviderFilter) Invoke(ctx context.Context, invoker protocol.In // interface blocked return sentinelDubboProviderFallback(ctx, invoker, invocation, b) } - ctx = context.WithValue(ctx, InterfaceEntryKey, interfaceEntry) + defer interfaceEntry.Exit() methodEntry, b = sentinel.Entry(methodResourceName, sentinel.WithResourceType(base.ResTypeRPC), @@ -140,12 +136,18 @@ func (d *sentinelProviderFilter) Invoke(ctx context.Context, invoker protocol.In // method blocked return sentinelDubboProviderFallback(ctx, invoker, invocation, b) } - ctx = context.WithValue(ctx, MethodEntryKey, methodEntry) - return invoker.Invoke(ctx, invocation) + defer methodEntry.Exit() + + result := invoker.Invoke(ctx, invocation) + if result.Error() != nil { + sentinel.TraceError(interfaceEntry, result.Error()) + sentinel.TraceError(methodEntry, result.Error()) + } + + return result } func (d *sentinelProviderFilter) OnResponse(ctx context.Context, result protocol.Result, _ protocol.Invoker, _ protocol.Invocation) protocol.Result { - sentinelExit(ctx, result) return result } @@ -158,6 +160,11 @@ type sentinelConsumerFilter struct{} func newSentinelConsumerFilter() filter.Filter { if sentinelConsumer == nil { + initOnce.Do(func() { + if err := sentinel.InitDefault(); err != nil { + panic(err) + } + }) consumerOnce.Do(func() { sentinelConsumer = &sentinelConsumerFilter{} }) @@ -178,7 +185,7 @@ func (d *sentinelConsumerFilter) Invoke(ctx context.Context, invoker protocol.In // interface blocked return sentinelDubboConsumerFallback(ctx, invoker, invocation, b) } - ctx = context.WithValue(ctx, InterfaceEntryKey, interfaceEntry) + defer interfaceEntry.Exit() methodEntry, b = sentinel.Entry(methodResourceName, sentinel.WithResourceType(base.ResTypeRPC), sentinel.WithTrafficType(base.Outbound), sentinel.WithArgs(invocation.Arguments()...)) @@ -186,13 +193,17 @@ func (d *sentinelConsumerFilter) Invoke(ctx context.Context, invoker protocol.In //
(dubbo-go) branch main updated: Revert "feat: interleaved weighted round-robin load balance (#2405)" (#2604)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new ae70398ed Revert "feat: interleaved weighted round-robin load balance (#2405)" (#2604) ae70398ed is described below commit ae70398ed3162b313da45efd959d32427e72a84d Author: Xuewei Niu AuthorDate: Mon Mar 4 14:35:00 2024 +0800 Revert "feat: interleaved weighted round-robin load balance (#2405)" (#2604) This reverts commit 19d1da0a066bd135369eb2ce8611444fb3ad6514. --- .../interleavedweightedroundrobin/doc.go | 19 --- .../interleavedweightedroundrobin/iwrr.go | 130 - .../interleavedweightedroundrobin/loadbalance.go | 50 .../loadbalance_test.go| 73 cluster/loadbalance/loadbalance_benchmarks_test.go | 80 - common/constant/loadbalance.go | 13 +-- 6 files changed, 6 insertions(+), 359 deletions(-) diff --git a/cluster/loadbalance/interleavedweightedroundrobin/doc.go b/cluster/loadbalance/interleavedweightedroundrobin/doc.go deleted file mode 100644 index 2f5433c13..0 --- a/cluster/loadbalance/interleavedweightedroundrobin/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Package leastactive implements LeastActive load balance strategy. -package iwrr diff --git a/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go b/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go deleted file mode 100644 index e1d78a370..0 --- a/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package iwrr - -import ( - "math/rand" - "sync" - - "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" - "dubbo.apache.org/dubbo-go/v3/protocol" -) - -type iwrrEntry struct { - weight int64 - invoker protocol.Invoker - - next *iwrrEntry -} - -type iwrrQueue struct { - head *iwrrEntry - tail *iwrrEntry -} - -func NewIwrrQueue() *iwrrQueue { - return &iwrrQueue{} -} - -func (item *iwrrQueue) push(entry *iwrrEntry) { - entry.next = nil - tail := item.tail - item.tail = entry - if tail == nil { - item.head = entry - } else { - tail.next = entry - } -} - -func (item *iwrrQueue) pop() *iwrrEntry { - head := item.head - next := head.next - head.next = nil - item.head = next - if next == nil { - item.tail = nil - } - return head -} - -func (item *iwrrQueue) empty() bool { - return item.head == nil -} - -// InterleavedweightedRoundRobin struct -type interleavedweightedRoundRobin struct { - current *iwrrQueue - next*iwrrQueue - stepint64 - mu sync.Mutex -} - -func NewInterleavedweightedRoundRobin(invokers []protocol.Invoker, invocation protocol.Invocation) *interleavedweightedRoundRobin { - iwrrp := new(interleavedweightedRoundRobin) - iwrrp.current = NewIwrrQueue() - iwrrp.next = NewIwrrQueue() - - size := uint64(len(invokers)) -
(dubbo-go) branch main updated (f5cb529be -> 52c81032a)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git omit f5cb529be Revert "feat: interleaved weighted round-robin load balance (#2405)" This update removed existing revisions from the reference, leaving the reference pointing at a previous point in the repository history. * -- * -- N refs/heads/main (52c81032a) \ O -- O -- O (f5cb529be) Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: .../doc.go | 2 +- .../interleavedweightedroundrobin/iwrr.go | 130 + .../interleavedweightedroundrobin/loadbalance.go} | 43 +++ .../loadbalance_test.go| 26 ++--- common/constant/loadbalance.go | 13 ++- 5 files changed, 168 insertions(+), 46 deletions(-) copy cluster/loadbalance/{leastactive => interleavedweightedroundrobin}/doc.go (97%) create mode 100644 cluster/loadbalance/interleavedweightedroundrobin/iwrr.go copy cluster/{cluster/adaptivesvc/cluster.go => loadbalance/interleavedweightedroundrobin/loadbalance.go} (52%) copy cluster/loadbalance/{roundrobin => interleavedweightedroundrobin}/loadbalance_test.go (86%)
(dubbo-go) branch main updated: Revert "feat: interleaved weighted round-robin load balance (#2405)"
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new f5cb529be Revert "feat: interleaved weighted round-robin load balance (#2405)" f5cb529be is described below commit f5cb529be2ef80210036e0fd60417f0b40bad737 Author: Xuewei Niu AuthorDate: Mon Mar 4 11:57:10 2024 +0800 Revert "feat: interleaved weighted round-robin load balance (#2405)" This reverts commit 19d1da0a066bd135369eb2ce8611444fb3ad6514. --- .../interleavedweightedroundrobin/doc.go | 19 --- .../interleavedweightedroundrobin/iwrr.go | 130 - .../interleavedweightedroundrobin/loadbalance.go | 50 .../loadbalance_test.go| 73 common/constant/loadbalance.go | 13 +-- 5 files changed, 6 insertions(+), 279 deletions(-) diff --git a/cluster/loadbalance/interleavedweightedroundrobin/doc.go b/cluster/loadbalance/interleavedweightedroundrobin/doc.go deleted file mode 100644 index 2f5433c13..0 --- a/cluster/loadbalance/interleavedweightedroundrobin/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Package leastactive implements LeastActive load balance strategy. -package iwrr diff --git a/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go b/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go deleted file mode 100644 index e1d78a370..0 --- a/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package iwrr - -import ( - "math/rand" - "sync" - - "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" - "dubbo.apache.org/dubbo-go/v3/protocol" -) - -type iwrrEntry struct { - weight int64 - invoker protocol.Invoker - - next *iwrrEntry -} - -type iwrrQueue struct { - head *iwrrEntry - tail *iwrrEntry -} - -func NewIwrrQueue() *iwrrQueue { - return &iwrrQueue{} -} - -func (item *iwrrQueue) push(entry *iwrrEntry) { - entry.next = nil - tail := item.tail - item.tail = entry - if tail == nil { - item.head = entry - } else { - tail.next = entry - } -} - -func (item *iwrrQueue) pop() *iwrrEntry { - head := item.head - next := head.next - head.next = nil - item.head = next - if next == nil { - item.tail = nil - } - return head -} - -func (item *iwrrQueue) empty() bool { - return item.head == nil -} - -// InterleavedweightedRoundRobin struct -type interleavedweightedRoundRobin struct { - current *iwrrQueue - next*iwrrQueue - stepint64 - mu sync.Mutex -} - -func NewInterleavedweightedRoundRobin(invokers []protocol.Invoker, invocation protocol.Invocation) *interleavedweightedRoundRobin { - iwrrp := new(interleavedweightedRoundRobin) - iwrrp.current = NewIwrrQueue() - iwrrp.next = NewIwrrQueue() - - size := uint64(len(invokers)) - offset := rand.Uint64() % size - step := int64(0) - for idx := uint
(dubbo-go) branch main updated: fix Prometheus Pushgateway can not enable (#2594)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new e9cc9ea9b fix Prometheus Pushgateway can not enable (#2594) e9cc9ea9b is described below commit e9cc9ea9b3afb4759460492bc9264d95274b0c07 Author: foghost AuthorDate: Fri Feb 23 13:22:02 2024 +0800 fix Prometheus Pushgateway can not enable (#2594) --- metrics/options.go | 7 +++ 1 file changed, 7 insertions(+) diff --git a/metrics/options.go b/metrics/options.go index 8824df657..58542cc57 100644 --- a/metrics/options.go +++ b/metrics/options.go @@ -76,6 +76,13 @@ func WithPrometheusExporterEnabled() Option { } } +func WithPrometheusPushgatewayEnabled() Option { + return func(opts *Options) { + enabled := true + opts.Metrics.Prometheus.Pushgateway.Enabled = &enabled + } +} + func WithPrometheusGatewayUrl(url string) Option { return func(opts *Options) { opts.Metrics.Prometheus.Pushgateway.BaseUrl = url
(dubbo-go) branch release-3.1 updated: [3.1] cherry-pick ioutil replace to release-3.1 (#2597)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.1 by this push: new 8f81c76dc [3.1] cherry-pick ioutil replace to release-3.1 (#2597) 8f81c76dc is described below commit 8f81c76dc7696f0393fb982e8b7fefe17416d234 Author: dongjiang AuthorDate: Tue Feb 20 09:46:09 2024 +0800 [3.1] cherry-pick ioutil replace to release-3.1 (#2597) --- config/config_loader_options.go | 16 config/tls_config.go| 8 +++- config_center/file/impl.go | 14 -- config_center/file/listener.go | 14 -- go.mod | 2 +- go.sum | 9 - protocol/dubbo3/reflection/serverreflection.go | 11 +++ protocol/jsonrpc/http.go| 12 +++- protocol/jsonrpc/server.go | 17 + remoting/xds/mapping/handler.go | 14 +- remoting/xds/mapping/handler_test.go| 16 +--- xds/client/bootstrap/bootstrap.go | 22 -- xds/credentials/cert_manager.go | 10 ++ xds/credentials/certgenerate/generate_cert.go | 8 +++- xds/credentials/certgenerate/generate_csr.go| 6 ++ xds/credentials/certprovider/pemfile/watcher.go | 15 +-- xds/credentials/token_provider.go | 4 ++-- 17 files changed, 59 insertions(+), 139 deletions(-) diff --git a/config/config_loader_options.go b/config/config_loader_options.go index 03cbe1ff1..83736a548 100644 --- a/config/config_loader_options.go +++ b/config/config_loader_options.go @@ -18,26 +18,18 @@ package config import ( - "io/ioutil" "os" "path/filepath" "runtime" "strings" -) -import ( + "dubbo.apache.org/dubbo-go/v3/common/constant" + "dubbo.apache.org/dubbo-go/v3/common/constant/file" "github.com/dubbogo/gost/log/logger" - "github.com/knadh/koanf" - "github.com/pkg/errors" ) -import ( - "dubbo.apache.org/dubbo-go/v3/common/constant" - "dubbo.apache.org/dubbo-go/v3/common/constant/file" -) - type loaderConf struct { suffix string // loaderConf file extension default yaml path string // loaderConf file path default ./conf/dubbogo.yaml @@ -66,7 +58,7 @@ func NewLoaderConf(opts ...LoaderConfOption) *loaderConf { return conf } if len(conf.bytes) <= 0 { - if bytes, err := ioutil.ReadFile(conf.path); err != nil { + if bytes, err := os.ReadFile(conf.path); err != nil { panic(err) } else { conf.bytes = bytes @@ -108,7 +100,7 @@ func WithSuffix(suffix file.Suffix) LoaderConfOption { func WithPath(path string) LoaderConfOption { return loaderConfigFunc(func(conf *loaderConf) { conf.path = absolutePath(path) - if bytes, err := ioutil.ReadFile(conf.path); err != nil { + if bytes, err := os.ReadFile(conf.path); err != nil { panic(err) } else { conf.bytes = bytes diff --git a/config/tls_config.go b/config/tls_config.go index 97c79ec2c..b5da5ba85 100644 --- a/config/tls_config.go +++ b/config/tls_config.go @@ -20,10 +20,8 @@ package config import ( "crypto/tls" "crypto/x509" - "io/ioutil" -) + "os" -import ( "dubbo.apache.org/dubbo-go/v3/common/constant" ) @@ -50,7 +48,7 @@ func GetServerTlsConfig(opt *TLSConfig) (*tls.Config, error) { //need mTLS if opt.CACertFile != "" { ca = x509.NewCertPool() - caBytes, err := ioutil.ReadFile(opt.CACertFile) + caBytes, err := os.ReadFile(opt.CACertFile) if err != nil { return nil, err } @@ -80,7 +78,7 @@ func GetClientTlsConfig(opt *TLSConfig) (*tls.Config, error) { ServerName: opt.TLSServerName, } ca := x509.NewCertPool() - caBytes, err := ioutil.ReadFile(opt.CACertFile) + caBytes, err := os.ReadFile(opt.CACertFile) if err != nil { return nil, err } diff --git a/config_center/file/impl.go b/config_center/file/impl.go index 2261eba15..061b01587 100644 --- a/config_center/file/impl.go +++ b/config_center/file/impl.go @@ -20,25 +20,19 @@ package file import ( "bytes" "errors
(dubbo-go) branch main updated: chores: replace deprecation ioutil functions (#2593)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new abb51f582 chores: replace deprecation ioutil functions (#2593) abb51f582 is described below commit abb51f58228a8ef1ef1e33817f5f28bbc3859574 Author: dongjiang AuthorDate: Mon Feb 19 13:19:38 2024 +0800 chores: replace deprecation ioutil functions (#2593) --- config/config_loader_options.go | 16 config/tls_config.go| 8 +++- config_center/file/impl.go | 14 -- config_center/file/listener.go | 14 -- go.mod | 2 +- go.sum | 9 - loader.go | 18 +- protocol/jsonrpc/http.go| 12 +++- protocol/jsonrpc/server.go | 17 + remoting/xds/mapping/handler.go | 14 +- remoting/xds/mapping/handler_test.go| 16 +--- xds/client/bootstrap/bootstrap.go | 22 -- xds/credentials/cert_manager.go | 10 ++ xds/credentials/certgenerate/generate_cert.go | 8 +++- xds/credentials/certgenerate/generate_csr.go| 6 ++ xds/credentials/certprovider/pemfile/watcher.go | 15 +-- xds/credentials/token_provider.go | 4 ++-- 17 files changed, 61 insertions(+), 144 deletions(-) diff --git a/config/config_loader_options.go b/config/config_loader_options.go index 03cbe1ff1..83736a548 100644 --- a/config/config_loader_options.go +++ b/config/config_loader_options.go @@ -18,26 +18,18 @@ package config import ( - "io/ioutil" "os" "path/filepath" "runtime" "strings" -) -import ( + "dubbo.apache.org/dubbo-go/v3/common/constant" + "dubbo.apache.org/dubbo-go/v3/common/constant/file" "github.com/dubbogo/gost/log/logger" - "github.com/knadh/koanf" - "github.com/pkg/errors" ) -import ( - "dubbo.apache.org/dubbo-go/v3/common/constant" - "dubbo.apache.org/dubbo-go/v3/common/constant/file" -) - type loaderConf struct { suffix string // loaderConf file extension default yaml path string // loaderConf file path default ./conf/dubbogo.yaml @@ -66,7 +58,7 @@ func NewLoaderConf(opts ...LoaderConfOption) *loaderConf { return conf } if len(conf.bytes) <= 0 { - if bytes, err := ioutil.ReadFile(conf.path); err != nil { + if bytes, err := os.ReadFile(conf.path); err != nil { panic(err) } else { conf.bytes = bytes @@ -108,7 +100,7 @@ func WithSuffix(suffix file.Suffix) LoaderConfOption { func WithPath(path string) LoaderConfOption { return loaderConfigFunc(func(conf *loaderConf) { conf.path = absolutePath(path) - if bytes, err := ioutil.ReadFile(conf.path); err != nil { + if bytes, err := os.ReadFile(conf.path); err != nil { panic(err) } else { conf.bytes = bytes diff --git a/config/tls_config.go b/config/tls_config.go index 97c79ec2c..b5da5ba85 100644 --- a/config/tls_config.go +++ b/config/tls_config.go @@ -20,10 +20,8 @@ package config import ( "crypto/tls" "crypto/x509" - "io/ioutil" -) + "os" -import ( "dubbo.apache.org/dubbo-go/v3/common/constant" ) @@ -50,7 +48,7 @@ func GetServerTlsConfig(opt *TLSConfig) (*tls.Config, error) { //need mTLS if opt.CACertFile != "" { ca = x509.NewCertPool() - caBytes, err := ioutil.ReadFile(opt.CACertFile) + caBytes, err := os.ReadFile(opt.CACertFile) if err != nil { return nil, err } @@ -80,7 +78,7 @@ func GetClientTlsConfig(opt *TLSConfig) (*tls.Config, error) { ServerName: opt.TLSServerName, } ca := x509.NewCertPool() - caBytes, err := ioutil.ReadFile(opt.CACertFile) + caBytes, err := os.ReadFile(opt.CACertFile) if err != nil { return nil, err } diff --git a/config_center/file/impl.go b/config_center/file/impl.go index 287ca1e10..ae1930ad9 100644 --- a/config_center/file/impl.go +++ b/config_center/file/impl.go @@ -20,25 +20,19 @@ package file import ( "bytes" "errors
(dubbo-go) branch main updated: feat: interleaved weighted round-robin load balance (#2405)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 19d1da0a0 feat: interleaved weighted round-robin load balance (#2405) 19d1da0a0 is described below commit 19d1da0a066bd135369eb2ce8611444fb3ad6514 Author: dongjiang AuthorDate: Fri Dec 29 10:49:04 2023 +0800 feat: interleaved weighted round-robin load balance (#2405) * dongjiang, add interleaved weighted roundrobin loadbalance Signed-off-by: dongjiang1989 * add benchmarks test case Signed-off-by: dongjiang1989 * fix unittest case name Signed-off-by: dongjiang1989 - Signed-off-by: dongjiang1989 --- .../interleavedweightedroundrobin/doc.go | 12 +- .../interleavedweightedroundrobin/iwrr.go | 130 + .../interleavedweightedroundrobin/loadbalance.go | 50 .../loadbalance_test.go| 73 cluster/loadbalance/loadbalance_benchmarks_test.go | 80 + common/constant/loadbalance.go | 13 ++- 6 files changed, 342 insertions(+), 16 deletions(-) diff --git a/common/constant/loadbalance.go b/cluster/loadbalance/interleavedweightedroundrobin/doc.go similarity index 71% copy from common/constant/loadbalance.go copy to cluster/loadbalance/interleavedweightedroundrobin/doc.go index dde844337..2f5433c13 100644 --- a/common/constant/loadbalance.go +++ b/cluster/loadbalance/interleavedweightedroundrobin/doc.go @@ -15,13 +15,5 @@ * limitations under the License. */ -package constant - -const ( - LoadBalanceKeyConsistentHashing = "consistenthashing" - LoadBalanceKeyLeastActive = "leastactive" - LoadBalanceKeyRandom= "random" - LoadBalanceKeyRoundRobin= "roundrobin" - LoadBalanceKeyP2C = "p2c" - LoadXDSRingHash = "xdsringhash" -) +// Package leastactive implements LeastActive load balance strategy. +package iwrr diff --git a/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go b/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go new file mode 100644 index 0..e1d78a370 --- /dev/null +++ b/cluster/loadbalance/interleavedweightedroundrobin/iwrr.go @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package iwrr + +import ( + "math/rand" + "sync" + + "dubbo.apache.org/dubbo-go/v3/cluster/loadbalance" + "dubbo.apache.org/dubbo-go/v3/protocol" +) + +type iwrrEntry struct { + weight int64 + invoker protocol.Invoker + + next *iwrrEntry +} + +type iwrrQueue struct { + head *iwrrEntry + tail *iwrrEntry +} + +func NewIwrrQueue() *iwrrQueue { + return &iwrrQueue{} +} + +func (item *iwrrQueue) push(entry *iwrrEntry) { + entry.next = nil + tail := item.tail + item.tail = entry + if tail == nil { + item.head = entry + } else { + tail.next = entry + } +} + +func (item *iwrrQueue) pop() *iwrrEntry { + head := item.head + next := head.next + head.next = nil + item.head = next + if next == nil { + item.tail = nil + } + return head +} + +func (item *iwrrQueue) empty() bool { + return item.head == nil +} + +// InterleavedweightedRoundRobin struct +type interleavedweightedRoundRobin struct { + current *iwrrQueue + next*iwrrQueue + stepint64 + mu sync.Mutex +} + +func NewInterleavedweightedRoundRobin(invokers []protocol.Invoker, invocation protocol.Invocation) *interleavedweightedRoundRobin { + iwrrp := new(interleavedweightedRoundRobin) + iwrrp.current = NewIwrrQueue() + iwrrp.next = NewIwrrQueue() + + size := uint64(len(invokers)) + offset := rand.Uint64() % size + step := int64(0) + for idx := uint64(0); idx &l
(dubbo-go) annotated tag v3.1.1-rc1 updated (d204c4ef4 -> 396292746)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to annotated tag v3.1.1-rc1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git *** WARNING: tag v3.1.1-rc1 was modified! *** from d204c4ef4 (commit) to 396292746 (tag) tagging d204c4ef491dd22c58c4fd2e0a30e0f9d4e57715 (commit) replaces v3.0.4-rc1 by Xuewei Niu on Sat Dec 2 13:59:09 2023 +0800 - Log - v3.1.1 release candidate 1 --- No new revisions were added by this update. Summary of changes:
svn commit: r65796 - in /dev/dubbo: KEYS dubbo-go/v3.1.1-rc1/ dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.asc dubbo-go/v3.1.1-rc1/dubbo-go-v3.
Author: justxuewei Date: Sat Dec 2 06:17:11 2023 New Revision: 65796 Log: Release dubbo-go v3.1.1-rc1 Added: dev/dubbo/dubbo-go/v3.1.1-rc1/ dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz (with props) dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.sha512 Modified: dev/dubbo/KEYS Modified: dev/dubbo/KEYS == --- dev/dubbo/KEYS (original) +++ dev/dubbo/KEYS Sat Dec 2 06:17:11 2023 @@ -163,4 +163,51 @@ xaRhyUaBsR8bk5DZAA3r6F4HDdXYiSOSc0RBelUb KuX4SUKeBMFrkiexwu6EzEUv2KAt2AL+u63Gp2INgB6XjFbks+LDuKEZ6zVSmRSq c7U0EOyQ20fZlrPl+x16trs= =eBm3 --END PGP PUBLIC KEY BLOCK- \ No newline at end of file +-END PGP PUBLIC KEY BLOCK-pub rsa3072 2022-12-04 [SC] + 8FDE893A8DE5184C7F76ECB9B9185984BF7D6735 +uid [ unknown] Xuewei Niu +sig 3B9185984BF7D6735 2022-12-04 Xuewei Niu +sub rsa3072 2022-12-04 [E] +sig B9185984BF7D6735 2022-12-04 Xuewei Niu + +-BEGIN PGP PUBLIC KEY BLOCK- + +mQGNBGOMD00BDACtny6PZ7wUSfBY+BmS353idxfg06n+j8LSaC1mKODldsTtLf2/ +pj+lX/zy7bfDIejzYUz6gkUmMKtyXgC+vlWoiRk2wSePJ+t8CqA19WGl1cTjft5u +P2AQVlnuHd+8OV7OsRqmJ57BTxfBJndQs23XFAVt8Uc0mdD3MVw60HXTkhjaG1jT +PPgq3rbqApwGHnx9W6SVP29FFOvoWBlcbjqaCfIrohuqZ7zUi8MOFVRz/WGNZ4ov +h+2AJbd1ZT3S58y6AsDhth5kV7qb3SGJmh5v0YLeuFtv7496X9VAWg9hIjJ0cb4P +Z8Ce67SRETwWA+bsbTYfASXVD4rZ5OQDxsNgrcbNRQPJTrZPkY+Pv3Wwns4COq45 +Fq+4xFNSgiMbEM8JijH7m7s6ZvVWbrNM0IBZnsYJqvct/8tVlq3eHcVyC+UJhBZH +KKuSrahLb47esWJAGPZq3ZCjFFX0yL8fgmPBqJ1YqRwfItf5v9gaP58uiHrWzF37 +3BfTTuesQSbadUMAEQEAAbQiWHVld2VpIE5pdSA8anVzdHh1ZXdlaUBhcGFjaGUu +b3JnPokBzgQTAQoAOBYhBI/eiTqN5RhMf3bsubkYWYS/fWc1BQJjjA9NAhsDBQsJ +CAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJELkYWYS/fWc1IHML/2aL8JQp28xBPOAE +T2mxdgvzOexxfsBm7uDPtaKv3wzG+YhBTOERsDXjxN7SVlLTSCBCeK7kP3vPK/eS +DdRu8WbKcpIUl96A0Eyb7JE6BIXkX004dCZPMsRhzVwhAaPpJO5zU7MBf+AcfVTv +1Xd94py2Qsg5Ok4HZEvRTJ6W/kL3H6FPMdbnfpzEruTAcLNa8mAxIuScSXB5ZJRh +kfF6Dgb4Qpth4oCso+5AguM7z6RVmynH9vb+rCWmJKYsWI0teba4cGVR4OGmwNdI +WDBy33PiT2gS+SiTMlrrgtiqfdskkN6hMrbL/R0e3gbbYhnFCgVqrDIcJsy1HynD +PN2PJHClre0hbTWPx3W+woGMo/kfuVoKWH6xRr2MDjIX8xtiBxIzrR/RJINTvovP +AQ4KcwYkWBMszXrJ6xJocU1MKFZP6D7rC9UrCFQyb+nmKtDy+G1+3y+da4/cJk2T +M4RThpzy4U3pRjsdCszaRJBD5xAxPVxrXBlPwh28/RtXdsuGibkBjQRjjA9NAQwA +3Iw9vMzORDa4emjD55gQfkam1OAn4pad0ddVZ9Lje1sTJXhYrGnBnafP4iHDsHP+ +hc8NK0Rb+NS9gmHRzzWGp7VEZwack+4gofY1N/078hQwuNo/QcrbB9OTEep3mge2 +3tYDWDuyzcWAHfqs+HNtYVk/A/plxaWBSBH+K5z38w/Z4civspNwiRoaAmrONjbf ++PQKLXgQw18ElIhZRR8Dwjd5eWUUrAqf4MHkyLt9QC5MdlazUGbQ9fuzhec6jOOo +SQ1bHHpuMmVY9wZ/Vwq0JC/UzBdQKCpG+wN3ziIzicEYkNcP/5mp3p/xgMt4aYFN +TAgZREMxGGKLxtoOue6CA11S+c2ITeWTGb2nVt1kVjBIPSByMdMiEAyqNqxtpB6b +IQ1oWiR5WdRAAraPtBcS3EvT+104EqXBXUP1uNTA8xbVlyQsj01YsOA1Ok5n3oBB +W9vHZXXuUz8Bw81ca5MnuzInXbpMvlq+8dr8f+zeErEuLV1eUk7hAi8KhdjMOaoJ +ABEBAAGJAbYEGAEKACAWIQSP3ok6jeUYTH927Lm5GFmEv31nNQUCY4wPTQIbDAAK +CRC5GFmEv31nNWe0DACK5LITRbi18jmlz0H/on/UNhISmfGaLyMQ+6K1dRzxw/cw +ynnd4+Zi/zSzO9b8RwYBciopThU+/wU54eTyZE2n8M1E7IaYDCXqsn4wfshPsb+U +WJqna+S1K58m8g00Ne/QnhByXSFgaS5QxKxLP3nXFJlqme6NqFG88ZeDmbekqir5 +y2lD/pwmHIr/rkhAqCKCVa+OiTqem5IuPfNDP+oRWz/pCgl4v46r9r8jMfGXfhaJ +QdRJEtY6+EeYy+FChiiolwwbF3Uruj2oAh7B4+PsYVjT2jcGg7wypP+biZJbOHE0 +ZhpLwXCmGeuH7scD2a/m1T5dL/cXV0eGjC5X2IRr0AkixVAdoodqyvpi7VulASTU +UtiFn5Sgf1eY0Fb8vWYUSLwjT2S2QzQuXyWgM57/8Mx9apIyQ9gjRpFgVN13R7oc +GT3jr7g2FK4e9RuweMQnEUg/6NKRHZ5fRw0GVMxHdnDgNq8EI9doEAG8mjY5dtD8 +leZT73QfheinAHp3nZ8= +=f8Wm +-END PGP PUBLIC KEY BLOCK- Added: dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz == Binary file - no diff available. Propchange: dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz -- svn:mime-type = application/octet-stream Added: dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.asc (added) +++ dev/dubbo/dubbo-go/v3.1.1-rc1/dubbo-go-v3.1.1-rc1-src.tar.gz.asc Sat Dec 2 06:17:11 2023 @@ -0,0 +1,14 @@ +-BEGIN PGP SIGNATURE- + +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmVqyFUWHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNfN+C/9N2pyxCMy0iTA7TnXCKlD6imqn +ESasSlKa0CkjGoJ2eAQRxn9SZhEnutd6/wRLJhEpHGp0hh3JD2mNsGJAYEJPPCd0 +zGrt/8etbm3bvlt8WD04rT4IJEP7IKfxCdw86oSbxLlMdBqc6K+mZ6d2DMFBKd2+ +cZy/Atp6rG8hXsLhcPhgevduJI+w3FxA0MPTAPgDZKFNk7wZSOQ1E5VdodDH5rse +PtXm/6dr18d1MWAFD8uovnQsMLMhJbmbdNAwUfJZc6tm+sdtl6Mbnc2X9Nkt3z7Y +/40B2dvXFC11XtOPii/o2fHZALoUE63kNVnIpwYNNS5/X40fJ3p/8kDcs7cC9pfJ ++X/M0ojmbjYyUOPjd/XzLip2tjbBZNV8NeIAH+AsN2DBgpo9CMI1Rir1jHDEvHsv +0+7eFRDyM3DXrL6KNr//D9TWHTvg6/FQrw0/AVwawlhuQGkWOc2vLaiksSeUG8PX +xTrTKPXKccmYWk6chA7C07/MZElMmHMxwN13Tq0= +=IAmO +-END PGP SIGNATURE
(dubbo-go) branch release-3.1 updated: docs: Update CHANGELOG for release v3.1.1-rc1 (#2530)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.1 by this push: new d204c4ef4 docs: Update CHANGELOG for release v3.1.1-rc1 (#2530) d204c4ef4 is described below commit d204c4ef491dd22c58c4fd2e0a30e0f9d4e57715 Author: Xuewei Niu AuthorDate: Sat Dec 2 13:57:25 2023 +0800 docs: Update CHANGELOG for release v3.1.1-rc1 (#2530) The CHANGLOG was updated to contain features, bugfixes and enhancements of release v3.1.1-rc1. Signed-off-by: Xuewei Niu --- CHANGELOG.md | 47 +++ 1 file changed, 47 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 795e41162..38e1772b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,53 @@ # Release Notes --- +## 3.1.1-rc1 + +### Features + +- [Wrapper sliding window with custom aggregator](https://github.com/apache/dubbo-go/pull/2358) +- [Wrapper sliding window with custom counter for caculating QPS](https://github.com/apache/dubbo-go/pull/2359) +- [Add some metrics](https://github.com/apache/dubbo-go/pull/2362) +- [Add registry metrics](https://github.com/apache/dubbo-go/pull/2366) +- [Add metadata rt metrics](https://github.com/apache/dubbo-go/pull/2363) +- [Add medata and config center metrics](https://github.com/apache/dubbo-go/pull/2357) +- [Introduce metrics bus](https://github.com/apache/dubbo-go/pull/2351) +- [Add metrics base api interface](https://github.com/apache/dubbo-go/pull/2350) +- [Implement meta cache](https://github.com/apache/dubbo-go/pull/2371) +- [Add prometheus pushgateway support](https://github.com/apache/dubbo-go/pull/2415) +- [Add switch for metric collector](https://github.com/apache/dubbo-go/pull/2424) +- [Add rpc exception metrics](https://github.com/apache/dubbo-go/pull/2459) + +### BugFixes + +- [Cache manager test](https://github.com/apache/dubbo-go/pull/2383) +- [Fix an issue that random ports can't be assgined](https://github.com/apache/dubbo-go/pull/2384) +- [Fix variable name typo](https://github.com/apache/dubbo-go/pull/2389) +- [Fix registry primitiveURL](https://github.com/apache/dubbo-go/pull/2385) +- [Fix health.proto has name conflict with the one in google.golang.org/grpc](https://github.com/apache/dubbo-go/pull/2395) +- [Rename 'one' to 'cacheOnce'](https://github.com/apache/dubbo-go/pull/2423) +- [Fix config random port](https://github.com/apache/dubbo-go/pull/2436) +- [Fix ConsumerConfig nil pointer problem](https://github.com/apache/dubbo-go/pull/2440) +- [Limit header size to avoid unexpected OOM](https://github.com/apache/dubbo-go/pull/2466) +- [Fix zookeeper and nacos issues working as registry, metadata and configcenter](https://github.com/apache/dubbo-go/pull/2369) +- [Fix service discovery subscription](https://github.com/apache/dubbo-go/pull/2480) + +### Enhancements + +- [Make rt metric more performance and easy to use](https://github.com/apache/dubbo-go/pull/2376) +- [Migrate old RT metric impl to new RT impl](https://github.com/apache/dubbo-go/pull/2390) +- [Nacos support subscribe to all with '*'](https://github.com/apache/dubbo-go/pull/2374) +- [Optimize the integration of otel tracing](https://github.com/apache/dubbo-go/pull/2387) +- [Add fmt make task](https://github.com/apache/dubbo-go/pull/2401) +- [Rewrite RPC metrics into the event pattern](https://github.com/apache/dubbo-go/pull/2392) +- [Change metric config to url like other module](https://github.com/apache/dubbo-go/pull/2396) +- [Simplify configuration when enable metrics](https://github.com/apache/dubbo-go/pull/2408) +- [Remove redundant nil check in Init](https://github.com/apache/dubbo-go/pull/2412) +- [Improve cache init time and add application name](https://github.com/apache/dubbo-go/pull/2420) +- [Zk registry support customize 'rootPath'](https://github.com/apache/dubbo-go/pull/2437) +- [Refactor metrics config](https://github.com/apache/dubbo-go/pull/2465) +- [Improve tag and configurator rules to keep up with official site](https://github.com/apache/dubbo-go/pull/2330) + ## 3.1.0 ### Features
(dubbo-go) branch release-3.0 updated: ci: Fix CI testing failure on push (#2471)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.0 by this push: new e65229c43 ci: Fix CI testing failure on push (#2471) e65229c43 is described below commit e65229c4337c953439772065c480b2ad3efca368 Author: Xuewei Niu AuthorDate: Sat Oct 28 19:11:54 2023 +0800 ci: Fix CI testing failure on push (#2471) `$GITHUB_BASE_NAME` is an invalid variable, and is replaced with `$GITHUB_REF_NAME` to acquire target branch of push. Replacing mod name in `integrate_test.sh` adapts a case of "apache/dubbo-go". It ensures that its mod name isn't changed to "github.com/apache/dubbo-go". Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 6 ++ integrate_test.sh| 19 ++- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 6fe4a8515..9acfd554b 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -77,12 +77,10 @@ jobs: run: | if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then chmod +x integrate_test.sh \ -&& [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] \ -&& [[ -n "${{github.event.pull_request.head.sha}}" ]] \ -&& [[ -n "${{github.base_ref}}" ]] \ && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}} elif [ "$GITHUB_EVENT_NAME" == "push" ]; then - chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF + chmod +x integrate_test.sh \ +&& ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_REF_NAME else echo "$GITHUB_EVENT_NAME is an unsupported event type." exit 1 diff --git a/integrate_test.sh b/integrate_test.sh index a0f88a076..374202c2e 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -17,29 +17,22 @@ #!/bin/bash set -e -set -x -echo 'start integrate-test' +echo "start integrate-test: repo = $1, SHA = $2, branch = $3" # set root workspace ROOT_DIR=$(pwd) echo "integrate-test root work-space -> ${ROOT_DIR}" -# show all github-env -echo "github current commit id -> $2" -echo "github pull request branch -> ${GITHUB_REF}" -echo "github pull request slug -> ${GITHUB_REPOSITORY}" -echo "github pull request repo slug -> ${GITHUB_REPOSITORY}" -echo "github pull request actor -> ${GITHUB_ACTOR}" -echo "github pull request repo param -> $1" -echo "github pull request base branch -> $3" -echo "github pull request head branch -> ${GITHUB_HEAD_REF}" - echo "use dubbo-go-samples $3 branch for integration testing" git clone -b $3 https://github.com/apache/dubbo-go-samples.git samples && cd samples # update dubbo-go to current commit id -go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +if [ "$1" == "apache/dubbo-go" ]; then +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=dubbo.apache.org/dubbo-go/v3@"$2" +else +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +fi go mod tidy
(dubbo-go) 01/01: ci: Fix CI testing failure on push (#2470)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git commit 216a146f33beecf714822d84fcacbfb85e665af5 Author: Xuewei Niu AuthorDate: Sat Oct 28 19:01:13 2023 +0800 ci: Fix CI testing failure on push (#2470) `$GITHUB_BASE_NAME` is an invalid variable, and is replaced with `$GITHUB_REF_NAME` to acquire target branch of push. Replacing mod name in `integrate_test.sh` adapts a case of "apache/dubbo-go". It ensures that its mod name isn't changed to "github.com/apache/dubbo-go". Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 6 ++ integrate_test.sh| 19 ++- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 6fe4a8515..e15150cc8 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -77,12 +77,10 @@ jobs: run: | if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then chmod +x integrate_test.sh \ -&& [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] \ -&& [[ -n "${{github.event.pull_request.head.sha}}" ]] \ -&& [[ -n "${{github.base_ref}}" ]] \ && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}} elif [ "$GITHUB_EVENT_NAME" == "push" ]; then - chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF + chmod +x integrate_test.sh \ +&& ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_REF_NAME else echo "$GITHUB_EVENT_NAME is an unsupported event type." exit 1 diff --git a/integrate_test.sh b/integrate_test.sh index a0f88a076..374202c2e 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -17,29 +17,22 @@ #!/bin/bash set -e -set -x -echo 'start integrate-test' +echo "start integrate-test: repo = $1, SHA = $2, branch = $3" # set root workspace ROOT_DIR=$(pwd) echo "integrate-test root work-space -> ${ROOT_DIR}" -# show all github-env -echo "github current commit id -> $2" -echo "github pull request branch -> ${GITHUB_REF}" -echo "github pull request slug -> ${GITHUB_REPOSITORY}" -echo "github pull request repo slug -> ${GITHUB_REPOSITORY}" -echo "github pull request actor -> ${GITHUB_ACTOR}" -echo "github pull request repo param -> $1" -echo "github pull request base branch -> $3" -echo "github pull request head branch -> ${GITHUB_HEAD_REF}" - echo "use dubbo-go-samples $3 branch for integration testing" git clone -b $3 https://github.com/apache/dubbo-go-samples.git samples && cd samples # update dubbo-go to current commit id -go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +if [ "$1" == "apache/dubbo-go" ]; then +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=dubbo.apache.org/dubbo-go/v3@"$2" +else +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +fi go mod tidy
(dubbo-go) branch main updated (a481fa005 -> 216a146f3)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git discard a481fa005 ci: Fix CI testing failure on push (#2470) new 216a146f3 ci: Fix CI testing failure on push (#2470) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (a481fa005) \ N -- N -- N refs/heads/main (216a146f3) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
(dubbo-go) branch main updated: ci: Fix CI testing failure on push (#2470)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new a481fa005 ci: Fix CI testing failure on push (#2470) a481fa005 is described below commit a481fa005bb590f6ce7e0cadb75c0d0aff331f60 Author: Xuewei Niu AuthorDate: Sat Oct 28 19:01:13 2023 +0800 ci: Fix CI testing failure on push (#2470) `$GITHUB_BASE_NAME` is an invalid variable, and is replaced with `$GITHUB_REF_NAME` to acquire target branch of push. Replacing mod name in `integrate_test.sh` adapts a case of "apache/dubbo-go". It ensures that its mod name isn't changed to "github.com/apache/dubbo-go". Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 6 ++ integrate_test.sh| 19 ++- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 6fe4a8515..fa349e0d9 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -77,12 +77,10 @@ jobs: run: | if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then chmod +x integrate_test.sh \ -&& [[ -n "${{github.event.pull_request.head.repo.full_name}}" ]] \ -&& [[ -n "${{github.event.pull_request.head.sha}}" ]] \ -&& [[ -n "${{github.base_ref}}" ]] \ && ./integrate_test.sh ${{github.event.pull_request.head.repo.full_name}} ${{github.event.pull_request.head.sha}} ${{github.base_ref}} elif [ "$GITHUB_EVENT_NAME" == "push" ]; then - chmod +x integrate_test.sh && ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF + chmod +x integrate_test.sh \ +&& ./integrate_test.sh $GITHUB_REPOSITORY $GITHUB_SHA $GITHUB_BASE_REF else echo "$GITHUB_EVENT_NAME is an unsupported event type." exit 1 diff --git a/integrate_test.sh b/integrate_test.sh index a0f88a076..374202c2e 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -17,29 +17,22 @@ #!/bin/bash set -e -set -x -echo 'start integrate-test' +echo "start integrate-test: repo = $1, SHA = $2, branch = $3" # set root workspace ROOT_DIR=$(pwd) echo "integrate-test root work-space -> ${ROOT_DIR}" -# show all github-env -echo "github current commit id -> $2" -echo "github pull request branch -> ${GITHUB_REF}" -echo "github pull request slug -> ${GITHUB_REPOSITORY}" -echo "github pull request repo slug -> ${GITHUB_REPOSITORY}" -echo "github pull request actor -> ${GITHUB_ACTOR}" -echo "github pull request repo param -> $1" -echo "github pull request base branch -> $3" -echo "github pull request head branch -> ${GITHUB_HEAD_REF}" - echo "use dubbo-go-samples $3 branch for integration testing" git clone -b $3 https://github.com/apache/dubbo-go-samples.git samples && cd samples # update dubbo-go to current commit id -go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +if [ "$1" == "apache/dubbo-go" ]; then +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=dubbo.apache.org/dubbo-go/v3@"$2" +else +go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2" +fi go mod tidy
(dubbo-go) branch release-3.0 updated: ci: Clone from target branch (#2469)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.0 by this push: new 5735c8547 ci: Clone from target branch (#2469) 5735c8547 is described below commit 5735c85477d5936f9ad0a99c62f8a34b955ab29a Author: Xuewei Niu AuthorDate: Sat Oct 28 17:58:29 2023 +0800 ci: Clone from target branch (#2469) We are maintaining several branches at this time, e.g. release-3.0 and main. However, cloning dubbo-go-samples for integrate testing is still from master. This leads to CI failure on old branch, like release-3.0, when the master branch have received some breaking changes. Therefore, the dubbo-go-samples' branch is required to keep same as the target branch. Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 5 +++-- integrate_test.sh| 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 74933f9aa..6fe4a8515 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -2,7 +2,9 @@ name: CI on: push: -branches: "*" +branches: + - main + - 'release-*' pull_request: branches: "*" @@ -66,7 +68,6 @@ jobs: - name: Format code run: | go fmt ./... && git status && [[ -z `git status -s` ]] -# diff -u <(echo -n) <(gofmt -d -s .) - name: Verify run: | diff --git a/integrate_test.sh b/integrate_test.sh index f8ca76942..a0f88a076 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -36,7 +36,7 @@ echo "github pull request base branch -> $3" echo "github pull request head branch -> ${GITHUB_HEAD_REF}" echo "use dubbo-go-samples $3 branch for integration testing" -git clone -b master https://github.com/apache/dubbo-go-samples.git samples && cd samples +git clone -b $3 https://github.com/apache/dubbo-go-samples.git samples && cd samples # update dubbo-go to current commit id go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2"
(dubbo-go) branch main updated: ci: Clone from target branch (#2468)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 918f22a2d ci: Clone from target branch (#2468) 918f22a2d is described below commit 918f22a2d7c2081bb6440d4a5af1bc98594ad9b0 Author: Xuewei Niu AuthorDate: Sat Oct 28 17:58:22 2023 +0800 ci: Clone from target branch (#2468) We are maintaining several branches at this time, e.g. release-3.0 and main. However, cloning dubbo-go-samples for integrate testing is still from master. This leads to CI failure on old branch, like release-3.0, when the master branch have received some breaking changes. Therefore, the dubbo-go-samples' branch is required to keep same as the target branch. Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 4 +++- integrate_test.sh| 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 1c25fc534..6fe4a8515 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -2,7 +2,9 @@ name: CI on: push: -branches: "*" +branches: + - main + - 'release-*' pull_request: branches: "*" diff --git a/integrate_test.sh b/integrate_test.sh index f8ca76942..a0f88a076 100644 --- a/integrate_test.sh +++ b/integrate_test.sh @@ -36,7 +36,7 @@ echo "github pull request base branch -> $3" echo "github pull request head branch -> ${GITHUB_HEAD_REF}" echo "use dubbo-go-samples $3 branch for integration testing" -git clone -b master https://github.com/apache/dubbo-go-samples.git samples && cd samples +git clone -b $3 https://github.com/apache/dubbo-go-samples.git samples && cd samples # update dubbo-go to current commit id go mod edit -replace=dubbo.apache.org/dubbo-go/v3=github.com/"$1"/v3@"$2"
(dubbo-go-samples) branch release-3.0 updated (e83dbf31 -> 52d8bf8b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git omit e83dbf31 Merge pull request #582 from wudong5/task_shop omit 86d6e8bf Build(deps): bump actions/checkout from 3.5.3 to 4.0.0 (#605) omit 541e0268 Merge pull request #599 from ev1lQuark/metrics omit 407f1e13 fix: imports format omit 86e50baa feat: random rt omit 7cce362a feat: metrics client send requests in a loop omit fc39c7a9 Build(deps): bump google.golang.org/grpc from 1.56.2 to 1.57.0 (#596) omit b03daf84 add more version omit facc2e4a fix merge omit 0f60c330 merge omit 2fe84946 add readme omit 8f256ba6 add readme omit dfa91fd8 Build(deps): bump google.golang.org/grpc from 1.56.0 to 1.56.2 (#594) omit fe6a14d0 Build(deps): bump google.golang.org/grpc in /mesh/go-client (#593) omit 63bc637d Build(deps): bump google.golang.org/grpc in /mesh/go-server (#592) omit 87afec17 Build(deps): bump google.golang.org/grpc in /proxyless/go-server (#590) omit 18d8527d upgrade gost v1.14.0 (#570) omit b021d1cf add license omit fa7f9588 fix import bug omit 97ae9e94 fix mod bug omit 3c61f957 dubbo go shop framework This update removed existing revisions from the reference, leaving the reference pointing at a previous point in the repository history. * -- * -- N refs/heads/release-3.0 (52d8bf8b) \ O -- O -- O (e83dbf31) Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. No new revisions were added by this update. Summary of changes: .github/workflows/github-actions.yml |4 +- go.mod |6 +- go.sum | 70 +- mesh/go-client/go.mod | 27 +- mesh/go-client/go.sum | 66 +- mesh/go-server/go.mod | 36 +- mesh/go-server/go.sum | 76 +- metrics/go-client/cmd/client.go| 26 +- metrics/go-client/conf/dubbogo.yml |8 +- metrics/go-server/cmd/server.go| 60 +- metrics/go-server/conf/dubbogo.yml |5 +- proxyless/go-server/go.mod | 30 +- proxyless/go-server/go.sum | 64 +- task/shop/.images/shop-arc.png | Bin 46312 -> 0 bytes task/shop/READEME_CN.md| 18 - task/shop/comment/api/comment_api.pb.go| 234 task/shop/comment/api/comment_api.proto| 33 - task/shop/comment/api/comment_api_triple.pb.go | 164 --- task/shop/comment/server_v1/cmd/server.go | 45 - task/shop/comment/server_v1/conf/dubbogo.yaml | 16 - task/shop/comment/server_v2/cmd/server.go | 45 - task/shop/comment/server_v2/conf/dubbogo.yaml | 16 - task/shop/comment/test/client/client.go| 48 - task/shop/comment/test/conf/dubbogo.yaml | 11 - task/shop/detail/api/detail_api.pb.go | 435 --- task/shop/detail/api/detail_api.proto | 50 - task/shop/detail/api/detail_api_triple.pb.go | 209 --- task/shop/detail/server_v1/cmd/server.go | 74 -- task/shop/detail/server_v1/conf/dubbogo.yaml | 16 - task/shop/detail/server_v2/cmd/server.go | 74 -- task/shop/detail/server_v2/conf/dubbogo.yaml | 16 - task/shop/detail/test/client/client.go | 49 - task/shop/detail/test/conf/dubbogo.yaml| 11 - task/shop/frontend/api/frontend_api.go | 40 - task/shop/frontend/cmd/main.go | 26 - task/shop/frontend/conf/dubbogo.yaml | 11 - task/shop/frontend/pages/router.go | 35 - task/shop/frontend/pages/server.go | 134 -- task/shop/frontend/pages/static/architecture.png | Bin 131625 -> 0 bytes task/shop/frontend/pages/static/goods.png | Bin 1850937 -> 0 bytes .../shop/frontend/pages/static/jquery-3.6.3.min.js |2 - task/shop/frontend/pages/templates/detail.html | 108 -- task/shop/frontend/pages/templates/index.html | 108 -- task/shop/frontend/server_v1/server.go | 130 -- task/shop/go.mod | 133 -- task/shop/go.sum | 1339 task/shop/order/api/order_api.pb.go| 299 - task/shop/order/api/order_api.proto| 40 - task/shop/order/api/order_api_triple.pb.go | 164 --- task/shop/order/server_v1/cmd/server.go| 64 - task/shop/order/server_v1/conf/dubbogo.yaml| 16 - task/shop/
(dubbo-go-samples) branch 1.5 deleted (was b1391088)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch 1.5 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was b1391088 包版本修正 (#470) The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) 01/01: 包版本修正 (#470)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-1.5 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git commit b13910882cbeb4a4402097345c50b4d22c4a020a Author: caochengxiang <714785...@qq.com> AuthorDate: Thu Dec 8 11:07:32 2022 +0800 包版本修正 (#470) Co-authored-by: zhangping17 --- go.mod | 10 +-- go.sum | 249 +++-- 2 files changed, 32 insertions(+), 227 deletions(-) diff --git a/go.mod b/go.mod index 172436dd..bd6891a1 100644 --- a/go.mod +++ b/go.mod @@ -2,11 +2,11 @@ module github.com/apache/dubbo-go-samples require ( github.com/alibaba/sentinel-golang v1.0.2 - github.com/apache/dubbo-getty v1.4.8 + github.com/apache/dubbo-getty v1.4.7 github.com/apache/dubbo-go v1.5.9 - github.com/apache/dubbo-go-hessian2 v1.11.4 + github.com/apache/dubbo-go-hessian2 v1.9.4 github.com/bwmarrin/snowflake v0.3.0 - github.com/dubbogo/gost v1.13.1 + github.com/dubbogo/gost v1.11.21-0.20220503144918-9e5ae44480af github.com/emicklei/go-restful/v3 v3.4.0 github.com/golang/protobuf v1.5.2 github.com/google/uuid v1.2.0 // indirect @@ -15,12 +15,12 @@ require ( github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5 github.com/openzipkin/zipkin-go v0.2.2 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.11.0 github.com/stretchr/testify v1.7.0 github.com/transaction-wg/seata-golang v1.0.1 github.com/uber/jaeger-client-go v2.22.1+incompatible github.com/uber/jaeger-lib v2.2.0+incompatible // indirect - google.golang.org/grpc v1.48.0 + google.golang.org/grpc v1.41.0 ) go 1.15 diff --git a/go.sum b/go.sum index 5a105229..0f87410f 100644 --- a/go.sum +++ b/go.sum @@ -6,32 +6,11 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU= github.com/AlexStocks/goext v0.3.3/go.mod h1:3M5j9Pjge4CdkNg2WIjRLUeoPedJHHKwkkglD
(dubbo-go-samples) branch release-1.5 created (now b1391088)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch release-1.5 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git at b1391088 包版本修正 (#470) This branch includes the following new commits: new b1391088 包版本修正 (#470) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(dubbo-go-samples) branch revert-552-integration_test_0402 deleted (was 28678770)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-552-integration_test_0402 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was 28678770 Revert "feat: token filter & config merge integrate test (#552)" The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) branch compress deleted (was dcc91f49)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch compress in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was dcc91f49 add test ppt file This change permanently discards the following revisions: discard dcc91f49 add test ppt file discard 397f1606 Pls. --> Pls discard b0939043 Merge branch 'master' of https://github.com/apache/dubbo-go-samples discard 82a37253 mod imports (#169) discard 6743ffe1 added Chinese readme for tracing/grpc (#133) discard f19f6f61 fix: add grpc provider reference in codes generated by protoc-gen-dubbo (#127) discard 2bbf31fa update: add `openzipkin`,`version` intro to dubbo-go readme, fix quote of openzipkin readme (#120) discard c178568f Feature/openzipkin (#119) discard 90edfdd2 Ftr: add rest test case (#103) discard e5ff594d Merge branch 'master' of https://github.com/apache/dubbo-go-samples discard d3073eb3 add: game api (#111) discard b16311f3 upgrade dubbo-go & dubbo-go-hessian2 version
(dubbo-go-samples) branch release-3.0 created (now e83dbf31)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git at e83dbf31 Merge pull request #582 from wudong5/task_shop No new revisions were added by this update.
(dubbo-go-samples) branch logger-readme deleted (was e51849c3)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch logger-readme in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was e51849c3 Update README.md The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) branch fix/jsonrpc-localip deleted (was 83e41c3b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch fix/jsonrpc-localip in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was 83e41c3b fix: import formatter The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) branch feature/skywalking deleted (was d27fe1eb)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch feature/skywalking in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was d27fe1eb add skywalking example The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) branch ftr/pb-generator deleted (was 3c926116)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch ftr/pb-generator in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was 3c926116 fix: grpc samples The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(dubbo-go-samples) branch main created (now e83dbf31)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git at e83dbf31 Merge pull request #582 from wudong5/task_shop No new revisions were added by this update.
[dubbo-go] branch main updated: fix: health.proto has name conflict with the one in google.golang.org/grpc (#2395)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 4b9bbd8e8 fix: health.proto has name conflict with the one in google.golang.org/grpc (#2395) 4b9bbd8e8 is described below commit 4b9bbd8e8ceb55e43d48250d0734d930b0384842 Author: Qin AuthorDate: Tue Sep 5 11:55:32 2023 +0800 fix: health.proto has name conflict with the one in google.golang.org/grpc (#2395) * fix: health.proto has name conflict with the one in google.golang.org/grpc health check in "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3/health/triple_health_v1" conflicts with the one in "google.golang.org/grpc/health/grpc_health_v1". Fixes #2394 * update license --- .../dubbo3/health/triple_health_v1/health.pb.go| 169 ++--- .../dubbo3/health/triple_health_v1/health.proto| 2 +- .../health/triple_health_v1/health_triple.pb.go| 27 ++-- 3 files changed, 93 insertions(+), 105 deletions(-) diff --git a/protocol/dubbo3/health/triple_health_v1/health.pb.go b/protocol/dubbo3/health/triple_health_v1/health.pb.go index e8bc5f970..499740042 100644 --- a/protocol/dubbo3/health/triple_health_v1/health.pb.go +++ b/protocol/dubbo3/health/triple_health_v1/health.pb.go @@ -20,21 +20,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protocv3.20.1 -// source: protocol/dubbo3/health/triple_health_v1/health.proto +// protoc-gen-go v1.30.0 +// protocv3.21.12 +// source: health.proto package triple_health_v1 -import ( - reflect "reflect" - sync "sync" -) - import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -80,11 +76,11 @@ func (x HealthCheckResponse_ServingStatus) String() string { } func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { - return file_protocol_dubbo3_health_triple_health_v1_health_proto_enumTypes[0].Descriptor() + return file_health_proto_enumTypes[0].Descriptor() } func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { - return &file_protocol_dubbo3_health_triple_health_v1_health_proto_enumTypes[0] + return &file_health_proto_enumTypes[0] } func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { @@ -93,7 +89,7 @@ func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { // Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead. func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int) { - return file_protocol_dubbo3_health_triple_health_v1_health_proto_rawDescGZIP(), []int{1, 0} + return file_health_proto_rawDescGZIP(), []int{1, 0} } type HealthCheckRequest struct { @@ -107,7 +103,7 @@ type HealthCheckRequest struct { func (x *HealthCheckRequest) Reset() { *x = HealthCheckRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protocol_dubbo3_health_triple_health_v1_health_proto_msgTypes[0] + mi := &file_health_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -120,7 +116,7 @@ func (x *HealthCheckRequest) String() string { func (*HealthCheckRequest) ProtoMessage() {} func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_protocol_dubbo3_health_triple_health_v1_health_proto_msgTypes[0] + mi := &file_health_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -133,7 +129,7 @@ func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead. func (*HealthCheckRequest) Descriptor() ([]byte, []int) { - return file_protocol_dubbo3_health_triple_health_v1_health_proto_rawDescGZIP(), []int{0} + return file_health_proto_rawDescGZIP(), []int{0} } func (x *HealthCheckRequest) GetService() string { @@ -148,13 +144,13 @@ type HealthCheckResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=grpc.health.v1.HealthCheckResponse_ServingStatus" json:"status,omitempty"` + Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enu
[dubbo-go] branch main updated: fix: variable name typo (#2389)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new c9c5a46f3 fix: variable name typo (#2389) c9c5a46f3 is described below commit c9c5a46f3f58f1147b6a3ef90c4b30d135e58f5e Author: Mustafa Ateş Uzun AuthorDate: Sat Aug 19 12:39:45 2023 +0300 fix: variable name typo (#2389) --- metrics/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metrics/api.go b/metrics/api.go index d274dd177..7dbcc7a19 100644 --- a/metrics/api.go +++ b/metrics/api.go @@ -198,13 +198,13 @@ type TimeMetric interface { const ( defaultBucketNum = 10 - defalutTimeWindowSeconds = 120 + defaultTimeWindowSeconds = 120 ) // NewTimeMetric init and write all data to registry func NewTimeMetric(min, max, avg, sum, last *MetricId, mr MetricRegistry) TimeMetric { return &DefaultTimeMetric{r: mr, min: min, max: max, avg: avg, sum: sum, last: last, - agg: aggregate.NewTimeWindowAggregator(defaultBucketNum, defalutTimeWindowSeconds)} + agg: aggregate.NewTimeWindowAggregator(defaultBucketNum, defaultTimeWindowSeconds)} } type DefaultTimeMetric struct {
[dubbo-go] branch main updated: Fix: cache manager test (#2383)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 6888010c2 Fix: cache manager test (#2383) 6888010c2 is described below commit 6888010c2941e708b3ecaefc886592f064ad45ea Author: finalt AuthorDate: Wed Aug 16 14:26:58 2023 +0800 Fix: cache manager test (#2383) * Fix: Increase the dump interval for cache manager test * fix bug --- .../service_instances_changed_listener_impl.go | 2 +- registry/servicediscovery/store/cache_manager.go | 56 ++ .../servicediscovery/store/cache_manager_test.go | 18 +++ 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/registry/servicediscovery/service_instances_changed_listener_impl.go b/registry/servicediscovery/service_instances_changed_listener_impl.go index e0714591a..8bd4ac873 100644 --- a/registry/servicediscovery/service_instances_changed_listener_impl.go +++ b/registry/servicediscovery/service_instances_changed_listener_impl.go @@ -42,7 +42,7 @@ var ( ) func init() { - cache, err := store.NewCacheManager(constant.DefaultMetaCacheName, constant.DefaultMetaFileName, time.Minute*10, constant.DefaultEntrySize) + cache, err := store.NewCacheManager(constant.DefaultMetaCacheName, constant.DefaultMetaFileName, time.Minute*10, constant.DefaultEntrySize, true) if err != nil { logger.Fatal("Failed to create cache [%s],the err is %v", constant.DefaultMetaCacheName, err) } diff --git a/registry/servicediscovery/store/cache_manager.go b/registry/servicediscovery/store/cache_manager.go index 861e51dc4..7228bc2bb 100644 --- a/registry/servicediscovery/store/cache_manager.go +++ b/registry/servicediscovery/store/cache_manager.go @@ -37,6 +37,7 @@ type CacheManager struct { stop chan struct{} // Channel used to stop the cache expiration routine cache*lru.Cache// The LRU cache implementation lock sync.Mutex + enableDump bool } type Item struct { @@ -45,13 +46,14 @@ type Item struct { } // NewCacheManager creates a new CacheManager instance. -// It initializes the cache manager with the provided parameters and starts a routine for cache expiration. -func NewCacheManager(name, cacheFile string, dumpInterval time.Duration, maxCacheSize int) (*CacheManager, error) { +// It initializes the cache manager with the provided parameters and starts a routine for cache dumping. +func NewCacheManager(name, cacheFile string, dumpInterval time.Duration, maxCacheSize int, enableDump bool) (*CacheManager, error) { cm := &CacheManager{ name: name, cacheFile:cacheFile, dumpInterval: dumpInterval, stop: make(chan struct{}), + enableDump: enableDump, } cache, err := lru.New(maxCacheSize) if err != nil { @@ -66,7 +68,9 @@ func NewCacheManager(name, cacheFile string, dumpInterval time.Duration, maxCach } } - go cm.RunDumpTask() + if enableDump { + cm.runDumpTask() + } return cm, nil } @@ -134,6 +138,7 @@ func (cm *CacheManager) dumpCache() error { if err != nil { return err } + defer file.Close() encoder := gob.NewEncoder(file) for k, v := range items { @@ -146,32 +151,43 @@ func (cm *CacheManager) dumpCache() error { return err } } - return file.Close() + return nil } -func (cm *CacheManager) RunDumpTask() { - ticker := time.NewTicker(cm.dumpInterval) - for { - select { - case <-ticker.C: - // Dump the cache to the file - if err := cm.dumpCache(); err != nil { - // Handle error - logger.Warnf("Failed to dump cache,the err is %v", err) - } else { - logger.Infof("Dumping [%s] caches, latest entries %d", cm.name, cm.cache.Len()) +func (cm *CacheManager) runDumpTask() { + go func() { + ticker := time.NewTicker(cm.dumpInterval) + for { + select { + case <-ticker.C: + // Dump the cache to the file + if err := cm.dumpCache(); err != nil { + // Handle error + logger.Warnf("Failed to dump cache,the err is %v", err) + } else { + logger.Infof("Dumping
[dubbo-go] branch main updated: Implement meta cache (#2371)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 1e78aaf53 Implement meta cache (#2371) 1e78aaf53 is described below commit 1e78aaf53cf29285a878a99ddeb46585e680944f Author: finalt AuthorDate: Fri Aug 11 17:06:09 2023 +0800 Implement meta cache (#2371) * implement cache manager * add meta cache * updata go mod * improve code * improve code * improve init time * update cache * fix bug * improve code * improve code * improve code --- common/constant/key.go | 7 + go.mod | 1 + go.sum | 1 + .../service_instances_changed_listener_impl.go | 36 +++- registry/servicediscovery/store/cache_manager.go | 182 + .../servicediscovery/store/cache_manager_test.go | 150 + 6 files changed, 374 insertions(+), 3 deletions(-) diff --git a/common/constant/key.go b/common/constant/key.go index b786b9951..383b57e57 100644 --- a/common/constant/key.go +++ b/common/constant/key.go @@ -416,3 +416,10 @@ const ( MetricsMetadata = "dubbo.metrics.metadata" MetricApp = "dubbo.metrics.app" ) + +// default meta cache config +const ( + DefaultMetaCacheName = "dubbo.meta" + DefaultMetaFileName = "dubbo.metadata" + DefaultEntrySize = 100 +) diff --git a/go.mod b/go.mod index d66112570..89764c71f 100644 --- a/go.mod +++ b/go.mod @@ -30,6 +30,7 @@ require ( github.com/google/uuid v1.3.0 github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 + github.com/hashicorp/golang-lru v0.5.4 github.com/hashicorp/vault/sdk v0.7.0 github.com/influxdata/tdigest v0.0.1 github.com/jinzhu/copier v0.3.5 diff --git a/go.sum b/go.sum index 5390019e4..3c47c9d14 100644 --- a/go.sum +++ b/go.sum @@ -801,6 +801,7 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= diff --git a/registry/servicediscovery/service_instances_changed_listener_impl.go b/registry/servicediscovery/service_instances_changed_listener_impl.go index a0039bdb2..e0714591a 100644 --- a/registry/servicediscovery/service_instances_changed_listener_impl.go +++ b/registry/servicediscovery/service_instances_changed_listener_impl.go @@ -19,6 +19,7 @@ package servicediscovery import ( "reflect" + "time" ) import ( @@ -32,9 +33,22 @@ import ( "dubbo.apache.org/dubbo-go/v3/common/constant" "dubbo.apache.org/dubbo-go/v3/common/extension" "dubbo.apache.org/dubbo-go/v3/registry" + "dubbo.apache.org/dubbo-go/v3/registry/servicediscovery/store" "dubbo.apache.org/dubbo-go/v3/remoting" ) +var ( + metaCache *store.CacheManager +) + +func init() { + cache, err := store.NewCacheManager(constant.DefaultMetaCacheName, constant.DefaultMetaFileName, time.Minute*10, constant.DefaultEntrySize) + if err != nil { + logger.Fatal("Failed to create cache [%s],the err is %v", constant.DefaultMetaCacheName, err) + } + metaCache = cache +} + // ServiceInstancesChangedListenerImpl The Service Discovery Changed Event Listener type ServiceInstancesChangedListenerImpl struct { serviceNames *gxset.HashSet @@ -88,9 +102,14 @@ func (lstn *ServiceInstancesChangedListenerImpl) OnEvent(e observer.Event) error revisionToInstances[revision] = append(subInstances, instance) metadataInfo := lstn.revisionToMetadata[revision] if metadataInfo == nil { - metadataInfo, err = GetMetadataInfo(instance, revision) - if err != nil { - return err + if va
[dubbo-go] tag v3.1.0 created (now cf92f8c09)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to tag v3.1.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at cf92f8c09 (commit) No new revisions were added by this update.
svn commit: r63053 - in /dev/dubbo: KEYS dubbo-go/v3.1.0-rc1/ dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.asc dubbo-go/v3.1.0-rc1/dubbo-go-v3.
Author: justxuewei Date: Tue Jul 18 03:34:09 2023 New Revision: 63053 Log: Release dubbo-go v3.1.0-rc1 Added: dev/dubbo/dubbo-go/v3.1.0-rc1/ dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz (with props) dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.sha512 Modified: dev/dubbo/KEYS Modified: dev/dubbo/KEYS == --- dev/dubbo/KEYS (original) +++ dev/dubbo/KEYS Tue Jul 18 03:34:09 2023 @@ -1,6 +1,6 @@ pub rsa3072 2022-12-04 [SC] 8FDE893A8DE5184C7F76ECB9B9185984BF7D6735 -uid [ultimate] Xuewei Niu +uid [ unknown] Xuewei Niu sig 3B9185984BF7D6735 2022-12-04 Xuewei Niu sub rsa3072 2022-12-04 [E] sig B9185984BF7D6735 2022-12-04 Xuewei Niu Added: dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz == Binary file - no diff available. Propchange: dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz -- svn:mime-type = application/octet-stream Added: dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.asc (added) +++ dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.asc Tue Jul 18 03:34:09 2023 @@ -0,0 +1,14 @@ +-BEGIN PGP SIGNATURE- + +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmS2Bo0WHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNbLaDACahwU5v/7TAHPvUY4+yRLemCsk +FeJ5/3rsgqe25sRK3jmQsHusnxdntPlcD+qQ2AgYusKvWiMqJ3F57HqzRBvO/J+N +Iqv8e8EEo/VjMkUJgg+97vx12yWBdKkq/mCPM5aafjtxf3dV6VPwp9eJsVO+Cyqf +2tJqQu4mRGXDrOG2XW8L47//6Ue6S67RPyyw6/rH2P2ULG0D6EMuQumD1UNO/XEc +iZ4Lhel/5f0HR8kQzCqG4jPBiaXpWD0dZXv1eglGgCYvd6twH53DePVWulEPSvhj +g/7davQDbinhC7qzIaOrMJKHPxV6a6q0GsT9KXnebkUGSRy7chY6PPlF9yVoEBmc +zlymnI2aSXxfq5RcTT8kjELM0M21pM6yYjK+1PUhV9Z8sk2MRPuCojAyT2lFtzS9 +BzFiEghdokcf7mnEzAxt2oKEzPooIdV13XGIsaEfmwCIzkNeZRdm1JnmsxkE5kcg +M/lqdJmssPNC79NlqgXiP2cbipbPJ8wENu3ZWDs= +=MlaC +-END PGP SIGNATURE- Added: dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.sha512 == --- dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.sha512 (added) +++ dev/dubbo/dubbo-go/v3.1.0-rc1/dubbo-go-v3.1.0-rc1-src.tar.gz.sha512 Tue Jul 18 03:34:09 2023 @@ -0,0 +1 @@ +691c49ea820d4b3cfe25d5b9f0e82f419386634968dd2fdc605ae098e28e120a55ef48f721fa12dfeb651b8d32744c2d911e77f755aaa51355200f753aca0ebb dubbo-go-v3.1.0-rc1-src.tar.gz
[dubbo-go] tag v3.1.0-rc1 created (now cf92f8c09)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to tag v3.1.0-rc1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at cf92f8c09 (commit) No new revisions were added by this update.
[dubbo-go] branch main updated: fix: disable metrics filter by default instead (#2354)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 1fb03b5cf fix: disable metrics filter by default instead (#2354) 1fb03b5cf is described below commit 1fb03b5cfbf81aee2e26057b3708bc339f1c4c47 Author: Wang Guan AuthorDate: Mon Jul 10 11:48:56 2023 +0800 fix: disable metrics filter by default instead (#2354) --- config/metric_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/metric_config.go b/config/metric_config.go index b47d48a56..3a819a30b 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -31,7 +31,7 @@ import ( type MetricConfig struct { Mode string `default:"pull" yaml:"mode" json:"mode,omitempty" property:"mode"` // push or pull, Namespace string `default:"dubbo" yaml:"namespace" json:"namespace,omitempty" property:"namespace"` - Enable *bool `default:"true" yaml:"enable" json:"enable,omitempty" property:"enable"` + Enable *bool `default:"false" yaml:"enable" json:"enable,omitempty" property:"enable"` Port string `default:"9090" yaml:"port" json:"port,omitempty" property:"port"` Path string `default:"/metrics" yaml:"path" json:"path,omitempty" property:"path"` PushGatewayAddress string `default:"" yaml:"push-gateway-address" json:"push-gateway-address,omitempty" property:"push-gateway-address"`
[dubbo-go] branch main updated: chore: pkg imported more than once (#2353)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new ab5be4ac3 chore: pkg imported more than once (#2353) ab5be4ac3 is described below commit ab5be4ac3b562da8ea6569d96f990eb0204cda49 Author: guangwu AuthorDate: Mon Jul 10 10:28:08 2023 +0800 chore: pkg imported more than once (#2353) --- protocol/dubbo3/health/serverhealth.go | 11 +-- xds/client/controller/transport.go | 3 +-- xds/client/controller/version/v2/loadreport.go | 5 ++--- xds/client/controller/version/v3/client.go | 5 ++--- xds/client/controller/version/v3/loadreport.go | 5 ++--- xds/csds/csds.go | 3 +-- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/protocol/dubbo3/health/serverhealth.go b/protocol/dubbo3/health/serverhealth.go index 6b22e7303..31e6afbc9 100644 --- a/protocol/dubbo3/health/serverhealth.go +++ b/protocol/dubbo3/health/serverhealth.go @@ -34,19 +34,18 @@ import ( import ( "dubbo.apache.org/dubbo-go/v3/config" healthpb "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3/health/triple_health_v1" - healthtriple "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3/health/triple_health_v1" ) // Server implements `service Health`. type DubbogoHealthServer struct { - healthtriple.UnimplementedHealthServer + healthpb.UnimplementedHealthServer mu sync.RWMutex // If shutdown is true, it's expected all serving status is NOT_SERVING, and // will stay in NOT_SERVING. shutdown bool // statusMap stores the serving status of the services this Server monitors. statusMap map[string]healthpb.HealthCheckResponse_ServingStatus - updates map[string]map[healthtriple.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus + updates map[string]map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus } var healthServer *DubbogoHealthServer @@ -55,7 +54,7 @@ var healthServer *DubbogoHealthServer func NewServer() *DubbogoHealthServer { return &DubbogoHealthServer{ statusMap: map[string]healthpb.HealthCheckResponse_ServingStatus{"": healthpb.HealthCheckResponse_SERVING}, - updates: make(map[string]map[healthtriple.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus), + updates: make(map[string]map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus), } } @@ -72,7 +71,7 @@ func (s *DubbogoHealthServer) Check(ctx context.Context, in *healthpb.HealthChec } // Watch implements `service Health`. -func (s *DubbogoHealthServer) Watch(in *healthpb.HealthCheckRequest, stream healthtriple.Health_WatchServer) error { +func (s *DubbogoHealthServer) Watch(in *healthpb.HealthCheckRequest, stream healthpb.Health_WatchServer) error { service := in.Service // update channel is used for getting service status updates. update := make(chan healthpb.HealthCheckResponse_ServingStatus, 1) @@ -86,7 +85,7 @@ func (s *DubbogoHealthServer) Watch(in *healthpb.HealthCheckRequest, stream heal // Registers the update channel to the correct place in the updates map. if _, ok := s.updates[service]; !ok { - s.updates[service] = make(map[healthtriple.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus) + s.updates[service] = make(map[healthpb.Health_WatchServer]chan healthpb.HealthCheckResponse_ServingStatus) } s.updates[service][stream] = update defer func() { diff --git a/xds/client/controller/transport.go b/xds/client/controller/transport.go index 59a7fb09d..043023e3f 100644 --- a/xds/client/controller/transport.go +++ b/xds/client/controller/transport.go @@ -36,7 +36,6 @@ import ( ) import ( - controllerversion "dubbo.apache.org/dubbo-go/v3/xds/client/controller/version" resourceversion "dubbo.apache.org/dubbo-go/v3/xds/client/controller/version" "dubbo.apache.org/dubbo-go/v3/xds/client/load" "dubbo.apache.org/dubbo-go/v3/xds/client/resource" @@ -380,7 +379,7 @@ func (t *Controller) processAckInfo(ack *ackAction, stream grpc.ClientStream) (t // reportLoad starts an LRS stream to report load data to the management server. // It blocks until the context is canceled. -func (t *Controller) reportLoad(ctx context.Context, cc *grpc.ClientConn, opts controllerversion.LoadReportingOptions) { +func (t *Controller) reportLoad(ctx context.Context, cc *grpc.ClientConn, opts resourceversion.LoadReportingOptions) { retries := 0 for { if ctx.Err() != nil { diff --git a/xds/client/co
[dubbo-go] branch main updated: chore: unnecessary use of fmt.Sprintf (#2352)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new f831ea571 chore: unnecessary use of fmt.Sprintf (#2352) f831ea571 is described below commit f831ea571c6ef2d713157b08f5e46f2115834e7e Author: guangwu AuthorDate: Sun Jul 9 19:57:07 2023 +0800 chore: unnecessary use of fmt.Sprintf (#2352) --- config/reference_config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/reference_config.go b/config/reference_config.go index 9eebae6eb..06797a8ec 100644 --- a/config/reference_config.go +++ b/config/reference_config.go @@ -143,7 +143,7 @@ func updateOrCreateMeshURL(rc *ReferenceConfig) { panic(fmt.Sprintf("Mesh mode enabled, Triple protocol expected but %v protocol found!", rc.Protocol)) } if rc.ProvidedBy == "" { - panic(fmt.Sprintf("Mesh mode enabled, provided-by should not be empty!")) + panic("Mesh mode enabled, provided-by should not be empty!") } podNamespace := getEnv(constant.PodNamespaceEnvKey, constant.DefaultNamespace)
[dubbo-website] branch master updated: Update custom-filter.md
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-website.git The following commit(s) were added to refs/heads/master by this push: new 4002c70a73 Update custom-filter.md 4002c70a73 is described below commit 4002c70a73ea62c29f9f964f5a8dad4a9b52c409 Author: Xuewei Niu AuthorDate: Sun Jul 9 16:26:17 2023 +0800 Update custom-filter.md --- .../tutorial/governance/features/custom-filter.md | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/content/zh-cn/overview/mannual/golang-sdk/tutorial/governance/features/custom-filter.md b/content/zh-cn/overview/mannual/golang-sdk/tutorial/governance/features/custom-filter.md index fe9f760d2d..53cc444a3a 100644 --- a/content/zh-cn/overview/mannual/golang-sdk/tutorial/governance/features/custom-filter.md +++ b/content/zh-cn/overview/mannual/golang-sdk/tutorial/governance/features/custom-filter.md @@ -58,15 +58,10 @@ Filter 采用面向切面设计的思路,通过对 Filter 的合理扩展, ## 3. 默认加载Filter -用户在配置文件中配置了将要使用的 Filter 时,框架使用用户配置的 Filter,否则则加载默认Filter: +用户在配置文件中配置了将要使用的 Filters 时,框架使用用户配置的 Filters 和默认 Filters,否则仅加载默认 Filters: -- Consumer: - - cshutdown - -- Provider: - - echo, metrics, token, accesslog, tps, generic_service, executivete, pshutdown +- Consumer: cshutdown +- Provider: echo, metrics, token, accesslog, tps, generic_service, executivete, pshutdown ## 4. 用户指定 Filter @@ -117,4 +112,4 @@ func (f *MyClientFilter) OnResponse(ctx context.Context, result protocol.Result, return result } -``` \ No newline at end of file +```
[dubbo-go] branch main updated: feat: add some metrics about RT (#2340)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new f6fdbfdf7 feat: add some metrics about RT (#2340) f6fdbfdf7 is described below commit f6fdbfdf772ad7f82ea64b8d861e4140c3fa17cb Author: Wang Guan AuthorDate: Tue Jul 4 13:34:20 2023 +0800 feat: add some metrics about RT (#2340) * feat: add min RT metrics * refactor: adapt to Go 1.17 and bundle gaugeVec with syncMap * feat: add max and sum RT metrics * feat: avg RT metrics * refactor: RT sum metrics * feat: last RT metrics * refactor: file names and method names --- metrics/prometheus/after_invocation.go | 49 - metrics/prometheus/before_invocation.go| 40 metrics/prometheus/constant.go | 8 +- metrics/prometheus/metric_set.go | 72 -- metrics/prometheus/{common.go => model.go} | 155 - metrics/prometheus/reporter.go | 79 --- metrics/prometheus/util.go | 75 ++ 7 files changed, 294 insertions(+), 184 deletions(-) diff --git a/metrics/prometheus/after_invocation.go b/metrics/prometheus/after_invocation.go deleted file mode 100644 index f1235a2d7..0 --- a/metrics/prometheus/after_invocation.go +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package prometheus - -import ( - "context" - "time" -) - -import ( - "dubbo.apache.org/dubbo-go/v3/protocol" -) - -func (reporter *PrometheusReporter) ReportAfterInvocation(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) { - if !reporter.reporterConfig.Enable { - return - } - url := invoker.GetURL() - - role := getRole(url) - if role == "" { - return - } - labels := buildLabels(url) - - reporter.reportRTSummaryVec(role, &labels, cost.Milliseconds()) - reporter.reportRequestsTotalCounterVec(role, &labels) - reporter.decRequestsProcessingTotalGaugeVec(role, &labels) - - if res != nil && res.Error() == nil { - // succeed - reporter.incRequestsSucceedTotalCounterVec(role, &labels) - } -} diff --git a/metrics/prometheus/before_invocation.go b/metrics/prometheus/before_invocation.go deleted file mode 100644 index 7477b1362..0 --- a/metrics/prometheus/before_invocation.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package prometheus - -import ( - "context" -) -import ( - "dubbo.apache.org/dubbo-go/v3/protocol" -) - -func (reporter *PrometheusReporter) ReportBeforeInvocation(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation) { - if !reporter.reporterConfig.Enable { - return - } - url := invoker.GetURL() - - role := getRole(url) - if role == "" { - return - } - labels := buildLabels(url) - - reporter.incRequestsProcessingTotalGaugeVec(role, &label
[dubbo-go] branch refactor-4.0 deleted (was ff1e96417)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch refactor-4.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git was ff1e96417 fix: solve config bool field zero value bug by using pointer (#2344) The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[dubbo-go] branch dev-4.0 created (now ff1e96417)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch dev-4.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at ff1e96417 fix: solve config bool field zero value bug by using pointer (#2344) No new revisions were added by this update.
[dubbo-go] branch refactor-dubbo-go-4.0 deleted (was ff1e96417)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch refactor-dubbo-go-4.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git was ff1e96417 fix: solve config bool field zero value bug by using pointer (#2344) The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[dubbo-go] branch refactor-4.0 created (now ff1e96417)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch refactor-4.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at ff1e96417 fix: solve config bool field zero value bug by using pointer (#2344) No new revisions were added by this update.
[dubbo-go] branch refactor-dubbo-go-4.0 created (now ff1e96417)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch refactor-dubbo-go-4.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at ff1e96417 fix: solve config bool field zero value bug by using pointer (#2344) No new revisions were added by this update.
[dubbo-go] branch main updated: fix:polaris service discovery cause nil panic (#2317)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new cbcfdb4f0 fix:polaris service discovery cause nil panic (#2317) cbcfdb4f0 is described below commit cbcfdb4f0c274ffb9e6a81a0db1bb8ae622b8a3e Author: liaochuntao AuthorDate: Wed May 31 12:17:41 2023 +0800 fix:polaris service discovery cause nil panic (#2317) --- registry/polaris/service_discovery.go | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/registry/polaris/service_discovery.go b/registry/polaris/service_discovery.go index 4bd3e0144..81398ce2c 100644 --- a/registry/polaris/service_discovery.go +++ b/registry/polaris/service_discovery.go @@ -79,11 +79,10 @@ func newPolarisServiceDiscovery(url *common.URL) (registry.ServiceDiscovery, err newInstance := &polarisServiceDiscovery{ namespace: discoveryURL.GetParam(constant.RegistryNamespaceKey, constant.PolarisDefaultNamespace), descriptor:descriptor, - instanceLock: &sync.RWMutex{}, consumer: consumerApi, provider: providerApi, + services: gxset.NewSet(), registryInstances: make(map[string]*PolarisInstanceInfo), - listenerLock: &sync.RWMutex{}, watchers: make(map[string]*PolarisServiceWatcher), } return newInstance, nil @@ -95,10 +94,10 @@ type polarisServiceDiscovery struct { provider api.ProviderAPI consumer api.ConsumerAPI services *gxset.HashSet - instanceLock *sync.RWMutex + instanceLock sync.RWMutex registryInstances map[string]*PolarisInstanceInfo watchers map[string]*PolarisServiceWatcher - listenerLock *sync.RWMutex + listenerLock sync.RWMutex } // Destroy destroy polarisServiceDiscovery, will do unregister all ServiceInstance
[dubbo-go-samples] branch master updated (94348a57 -> 3b2593cc)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from 94348a57 Merge pull request #577 from apache/lint-ci new ab4d36ad fix:polaris的dubbo注册粒度调整为interface new c8ad6bd1 fix:polaris的dubbo注册粒度调整为interface new 76a70401 fix:polaris的dubbo注册粒度调整为interface new 3b2593cc Merge pull request #576 from chuntaojun/master The 686 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: go.mod | 4 +- go.sum | 672 - polaris/limit/go-client/conf/dubbogo.yml | 1 + polaris/limit/go-server/conf/dubbogo.yml | 1 + polaris/registry/go-client/conf/dubbogo.yml| 1 + polaris/registry/go-server/conf/dubbogo.yml| 1 + polaris/router/go-client/conf/dubbogo.yaml | 1 + .../router/go-server/server-dev/conf/dubbogo.yaml | 1 + .../router/go-server/server-pre/conf/dubbogo.yaml | 1 + .../router/go-server/server-prod/conf/dubbogo.yaml | 1 + 10 files changed, 650 insertions(+), 34 deletions(-)
[dubbo-go-samples] branch lint-ci deleted (was 7e04af9b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch lint-ci in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git was 7e04af9b Update github-actions.yml The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[dubbo-go-samples] 01/01: Merge pull request #577 from apache/lint-ci
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git commit 94348a57b1bed8c39dc849c5aea36e5561f2df15 Merge: 5d096910 7e04af9b Author: Xuewei Niu AuthorDate: Mon May 29 10:53:29 2023 +0800 Merge pull request #577 from apache/lint-ci Change the Lint to golangci/golangci-lint-action@v3 .github/workflows/github-actions.yml | 9 - 1 file changed, 4 insertions(+), 5 deletions(-)
[dubbo-go-samples] branch master updated (5d096910 -> 94348a57)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from 5d096910 Build(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#573) add 3a7895f5 Change the Lint to golangci/golangci-lint-action@v3 add 7e04af9b Update github-actions.yml new 94348a57 Merge pull request #577 from apache/lint-ci The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/github-actions.yml | 9 - 1 file changed, 4 insertions(+), 5 deletions(-)
[dubbo-go-samples] branch lint-ci updated (3a7895f5 -> 7e04af9b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch lint-ci in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from 3a7895f5 Change the Lint to golangci/golangci-lint-action@v3 add 7e04af9b Update github-actions.yml No new revisions were added by this update. Summary of changes: .github/workflows/github-actions.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
[dubbo-go-samples] branch lint-ci created (now 3a7895f5)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch lint-ci in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git at 3a7895f5 Change the Lint to golangci/golangci-lint-action@v3 This branch includes the following new commits: new 3a7895f5 Change the Lint to golangci/golangci-lint-action@v3 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo-go-samples] 01/01: Change the Lint to golangci/golangci-lint-action@v3
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch lint-ci in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git commit 3a7895f50b8815598a335bb68de9fc0e26b2ff98 Author: Xuewei Niu AuthorDate: Mon May 29 10:19:41 2023 +0800 Change the Lint to golangci/golangci-lint-action@v3 --- .github/workflows/github-actions.yml | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 48b24633..535476a0 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -59,11 +59,8 @@ jobs: go fmt ./... && git status && [[ -z `git status -s` ]] # diff -u <(echo -n) <(gofmt -d -s .) - - name: Install go ci lint -run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.41.1 - - name: Run Linter -run: golangci-lint run --timeout=10m -v +uses: golangci/golangci-lint-action@v3 - name: License run: make -f build/Makefile license
[dubbo-go] branch main updated: fix: The metadata invoker is destroyed too early (#2322)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 9cf1b9f97 fix: The metadata invoker is destroyed too early (#2322) 9cf1b9f97 is described below commit 9cf1b9f976da0309a0049ff0c6f5f42eef8e584e Author: Xuewei Niu AuthorDate: Sun May 28 16:48:37 2023 +0800 fix: The metadata invoker is destroyed too early (#2322) The PR fixes the problem that the metadata invoker is destroyed too early. Please refer to the issue for more details. Plus, this PR updates some logs about registering services. Fixes: #2321 Signed-off-by: Xuewei Niu --- config/provider_config.go | 15 ++- config/service.go | 13 + metadata/service/local/service_proxy.go | 2 -- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/provider_config.go b/config/provider_config.go index d70cf6b0c..926fbf62e 100644 --- a/config/provider_config.go +++ b/config/provider_config.go @@ -164,19 +164,16 @@ func (c *ProviderConfig) Load() { continue } // service doesn't config in config file, create one with default - logger.Warnf("Dubbogo can not find service with registeredTypeName %s in configuration. Use the default configuration instead.", registeredTypeName) supportPBPackagerNameSerivce, ok := service.(common.TriplePBService) - serviceConfig = NewServiceConfigBuilder().Build() if !ok { - logger.Errorf("Dubbogo do not read service interface name with registeredTypeName = %s."+ - "Please run go install github.com/dubbogo/dubbogo-cli/cmd/protoc-gen-go-triple@latest to update your "+ - "protoc-gen-go-triple and re-generate your pb file again."+ - "If you are not using pb serialization, please set 'interface' field in service config.", registeredTypeName) + logger.Warnf( + "The provider service %s is ignored: neither the config is found, nor it is a valid Triple service.", + registeredTypeName) continue - } else { - // use interface name defined by pb - serviceConfig.Interface = supportPBPackagerNameSerivce.XXX_InterfaceName() } + serviceConfig = NewServiceConfigBuilder().Build() + // use interface name defined by pb + serviceConfig.Interface = supportPBPackagerNameSerivce.XXX_InterfaceName() if err := serviceConfig.Init(rootConfig); err != nil { logger.Errorf("Service with refKey = %s init failed with error = %s") } diff --git a/config/service.go b/config/service.go index 723847fca..b5314cbd3 100644 --- a/config/service.go +++ b/config/service.go @@ -19,10 +19,9 @@ package config import ( "sync" -) -import ( "dubbo.apache.org/dubbo-go/v3/common" + "github.com/dubbogo/gost/log/logger" ) var ( @@ -38,7 +37,10 @@ var ( func SetConsumerService(service common.RPCService) { ref := common.GetReference(service) conServicesLock.Lock() - defer conServicesLock.Unlock() + defer func() { + conServicesLock.Unlock() + logger.Debugf("A consumer service %s was registered successfully.", ref) + }() conServices[ref] = service } @@ -46,7 +48,10 @@ func SetConsumerService(service common.RPCService) { func SetProviderService(service common.RPCService) { ref := common.GetReference(service) proServicesLock.Lock() - defer proServicesLock.Unlock() + defer func() { + proServicesLock.Unlock() + logger.Debugf("A provider service %s was registered successfully.", ref) + }() proServices[ref] = service } diff --git a/metadata/service/local/service_proxy.go b/metadata/service/local/service_proxy.go index 98243509a..711058d8e 100644 --- a/metadata/service/local/service_proxy.go +++ b/metadata/service/local/service_proxy.go @@ -181,8 +181,6 @@ func (m *MetadataServiceProxy) GetMetadataInfo(revision string) (*common.Metadat invocation.WithAttachments(map[string]interface{}{constant.AsyncKey: "false"}), invocation.
[dubbo-go-samples] branch master updated: fix:use docker-compose to connect polaris
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git The following commit(s) were added to refs/heads/master by this push: new 0e3c8ec5 fix:use docker-compose to connect polaris new b56b292a Merge pull request #572 from chuntaojun/master 0e3c8ec5 is described below commit 0e3c8ec56ae6f10746b761f0bbcd1489c215d804 Author: chuntaojun AuthorDate: Sun May 21 17:53:53 2023 +0800 fix:use docker-compose to connect polaris --- integrate_test/dockercompose/docker-compose.yml| 18 ++ polaris/limit/go-client/conf/dubbogo.yml | 2 +- polaris/limit/go-server/conf/dubbogo.yml | 2 +- polaris/registry/go-client/conf/dubbogo.yml| 2 +- polaris/registry/go-server/conf/dubbogo.yml| 2 +- polaris/router/go-client/conf/dubbogo.yaml | 2 +- polaris/router/go-server/server-dev/conf/dubbogo.yaml | 2 +- polaris/router/go-server/server-pre/conf/dubbogo.yaml | 2 +- polaris/router/go-server/server-prod/conf/dubbogo.yaml | 2 +- 9 files changed, 26 insertions(+), 8 deletions(-) diff --git a/integrate_test/dockercompose/docker-compose.yml b/integrate_test/dockercompose/docker-compose.yml index d8767cbc..a1dcef56 100644 --- a/integrate_test/dockercompose/docker-compose.yml +++ b/integrate_test/dockercompose/docker-compose.yml @@ -22,6 +22,24 @@ services: test: "curl --fail http://127.0.0.1:8848/nacos/v1/console/health/liveness || exit 1" interval: 5s + polaris: +image: polarismesh/polaris-standalone:latest +container_name: polaris-standalone +privileged: true +ports: + - "15010:15010" + - "8101:8101" + - "8100:8100" + - "8080:8080" + - "8090:8090" + - "8091:8091" + - "8093:8093" + - "8761:8761" + - "9090:9090" +healthcheck: + test: "curl --fail http://127.0.0.1:8090 || exit 1" + interval: 5s + etcd: image: "quay.io/coreos/etcd:latest" container_name: etcd diff --git a/polaris/limit/go-client/conf/dubbogo.yml b/polaris/limit/go-client/conf/dubbogo.yml index 9ec2d455..c9338047 100644 --- a/polaris/limit/go-client/conf/dubbogo.yml +++ b/polaris/limit/go-client/conf/dubbogo.yml @@ -10,7 +10,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo consumer: references: diff --git a/polaris/limit/go-server/conf/dubbogo.yml b/polaris/limit/go-server/conf/dubbogo.yml index 4db4eec5..51a22262 100644 --- a/polaris/limit/go-server/conf/dubbogo.yml +++ b/polaris/limit/go-server/conf/dubbogo.yml @@ -10,7 +10,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo protocols: dubbo: diff --git a/polaris/registry/go-client/conf/dubbogo.yml b/polaris/registry/go-client/conf/dubbogo.yml index 8b9e2ae4..ce51c3ea 100644 --- a/polaris/registry/go-client/conf/dubbogo.yml +++ b/polaris/registry/go-client/conf/dubbogo.yml @@ -10,7 +10,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo consumer: references: diff --git a/polaris/registry/go-server/conf/dubbogo.yml b/polaris/registry/go-server/conf/dubbogo.yml index 5857bc50..a03e5fc7 100644 --- a/polaris/registry/go-server/conf/dubbogo.yml +++ b/polaris/registry/go-server/conf/dubbogo.yml @@ -10,7 +10,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo protocols: dubbo: diff --git a/polaris/router/go-client/conf/dubbogo.yaml b/polaris/router/go-client/conf/dubbogo.yaml index b47ee814..66d93668 100644 --- a/polaris/router/go-client/conf/dubbogo.yaml +++ b/polaris/router/go-client/conf/dubbogo.yaml @@ -11,7 +11,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo consumer: references: diff --git a/polaris/router/go-server/server-dev/conf/dubbogo.yaml b/polaris/router/go-server/server-dev/conf/dubbogo.yaml index 49fe6696..ca43bbf2 100644 --- a/polaris/router/go-server/server-dev/conf/dubbogo.yaml +++ b/polaris/router/go-server/server-dev/conf/dubbogo.yaml @@ -10,7 +10,7 @@ dubbo: registries: polarisMesh: protocol: polaris - address: 111.230.189.149:8091 + address: 127.0.0.1:8091 namespace: dubbogo protocols: dubbo: diff --git a/polaris/router/go-server/server-pre/conf/dubbogo.yaml b/polaris/router/go-server/server
[dubbo-go-samples] branch master updated (dd1c26e1 -> 42729532)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from dd1c26e1 Build(deps): bump actions/checkout from 3.5.0 to 3.5.2 (#558) new 495a6ea8 feat: polaris integrate test new 451fff93 feat: polaris integrate test new 42729532 Merge pull request #550 from ZLBer/integration_test_0401 The 671 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../limit/tests/integration/limit_test.go} | 25 +++--- .../limit}/tests/integration/main_test.go | 38 +++--- .../registry}/tests/integration/main_test.go | 38 +++--- .../registry/tests/integration/registry_test.go} | 20 ++-- .../go-server/conf/{dubbogo.yaml => dubbogo.yml} | 0 start_integrate_test.sh| 3 ++ 6 files changed, 64 insertions(+), 60 deletions(-) copy integrate_test/{registry/all/nacos/tests/integration/greeter_test.go => polaris/limit/tests/integration/limit_test.go} (72%) copy integrate_test/{registry/nacos => polaris/limit}/tests/integration/main_test.go (96%) copy integrate_test/{registry/nacos => polaris/registry}/tests/integration/main_test.go (96%) copy integrate_test/{tls/triple/tests/integration/user_test.go => polaris/registry/tests/integration/registry_test.go} (69%) rename polaris/limit/go-server/conf/{dubbogo.yaml => dubbogo.yml} (100%)
[dubbo-go-samples] branch master updated (8dd4dd0d -> df4c996b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from 8dd4dd0d Merge pull request #556 from justxuewei/bump-go-117 new 0116f495 feat: token filter integrate test new 63006321 feat: config merge integrate test new ab45cdf3 feat: config merge integrate test new df4c996b Merge pull request #554 from ZLBer/integration_test_0402 The 666 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../config-merge}/tests/integration/main_test.go | 6 ++ .../config-merge/tests/integration/merge_test.go} | 10 ++ .../filter/{custom => token}/tests/integration/main_test.go| 6 ++ .../tests/integration/token_test.go} | 10 ++ start_integrate_test.sh| 2 ++ 5 files changed, 18 insertions(+), 16 deletions(-) copy integrate_test/{filter/custom => config-api/config-merge}/tests/integration/main_test.go (94%) copy integrate_test/{filter/custom/tests/integration/userprovider_test.go => config-api/config-merge/tests/integration/merge_test.go} (88%) copy integrate_test/filter/{custom => token}/tests/integration/main_test.go (94%) copy integrate_test/filter/{custom/tests/integration/userprovider_test.go => token/tests/integration/token_test.go} (88%)
[dubbo-go] branch main updated: Start a new routine when subscribing (#2297)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 3fcc135f2 Start a new routine when subscribing (#2297) 3fcc135f2 is described below commit 3fcc135f200431b186424c38ccd576cb0368f6d3 Author: Ken Liu AuthorDate: Fri Apr 7 17:47:00 2023 +0800 Start a new routine when subscribing (#2297) --- registry/protocol/protocol.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index cbc610a06..822f62207 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -161,7 +161,7 @@ func (proto *registryProtocol) Refer(url *common.URL) protocol.Invoker { logger.Errorf("Directory %v is expected to implement Directory, and will return nil invoker!", dic) return nil } - regDic.Subscribe(registryUrl.SubURL) + go regDic.Subscribe(registryUrl.SubURL) err = reg.Register(serviceUrl) if err != nil {
[dubbo-go] branch main updated: ci: Enable integration testing for push event (#2296)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/main by this push: new 2efc13eea ci: Enable integration testing for push event (#2296) 2efc13eea is described below commit 2efc13eeac37d37b61b4d231ebdadf671a1980e3 Author: Xuewei Niu AuthorDate: Fri Apr 7 12:29:09 2023 +0800 ci: Enable integration testing for push event (#2296) Remove the 'if' condition from the Integration Testing to enable testing for push events. Additionally, this commit removes unnecessary logs of certain environment variables. Fixes: #2295 Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 7fafb5b9b..1c25fc534 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -46,7 +46,6 @@ jobs: - name: Merge code into the upstream if: ${{ github.event_name == 'pull_request' }} run: | -echo "$GITHUB_BASE_REF, $GITHUB_REF_NAME, $GITHUB_REF" git fetch origin $GITHUB_BASE_REF git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF git remote add devrepo https://github.com/${{github.event.pull_request.head.repo.full_name}}.git @@ -72,9 +71,7 @@ jobs: run: | make verify -# This step only runs when the event type is a pull_request - name: Integration Testing - if: ${{ github.event_name == 'pull_request' }} run: | if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then chmod +x integrate_test.sh \
[dubbo-go] branch release-3.0 updated: [3.0] ci: Enable integration testing for push event (#2294)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.0 by this push: new 2e80ad95c [3.0] ci: Enable integration testing for push event (#2294) 2e80ad95c is described below commit 2e80ad95c11a52555d60e95850a5cda0c0528716 Author: Xuewei Niu AuthorDate: Thu Apr 6 17:09:50 2023 +0800 [3.0] ci: Enable integration testing for push event (#2294) Signed-off-by: Xuewei Niu --- .github/workflows/github-actions.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 35616155b..74933f9aa 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -72,9 +72,7 @@ jobs: run: | make verify -# This step only runs when the event type is a pull_request - name: Integration Testing - if: ${{ github.event_name == 'pull_request' }} run: | if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then chmod +x integrate_test.sh \
[dubbo-go] branch main2 created (now 6361d9f5c)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch main2 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 6361d9f5c [FIX]:'all' should be followed by the plural form of the noun. (#2286) No new revisions were added by this update.
[dubbo-go] branch revert-2280-fix/github-action created (now b0a4fff59)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-2280-fix/github-action in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at b0a4fff59 Revert "ci: Fix CI failures after branch adjustment (#2280)" No new revisions were added by this update.
[dubbo-go-samples] branch master updated (a0812c77 -> 8dd4dd0d)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from a0812c77 Merge pull request #555 from justxuewei/fix-go new e7cfb18f ci: Bump Go version of CI to 1.17 new 4b94bb72 ci: Fix issues reported by golangci-lint new 8dd4dd0d Merge pull request #556 from justxuewei/bump-go-117 The 662 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/github-actions.yml | 2 +- async/go-client/pkg/user.go | 1 - polaris/router/go-client/cmd/main.go | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-)
[dubbo-go-samples] branch master updated: ci: Fix go build issues
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git The following commit(s) were added to refs/heads/master by this push: new 280bff1e ci: Fix go build issues new a0812c77 Merge pull request #555 from justxuewei/fix-go 280bff1e is described below commit 280bff1eca6db6516b3c08af27129fdf04527dcc Author: Xuewei Niu AuthorDate: Wed Apr 5 23:07:08 2023 +0800 ci: Fix go build issues `-i` flag was removed from the Go 1.17, see https://github.com/golang/go/issues/41696. Besides, this PR fixes a jsonrpc issue that has three same interface names. `DOCKER_HOST_IP` is not used. Obtaining it depends on ifconfig, which is not built-in on Ubuntu. This could lead to the command not found issue. Signed-off-by: Xuewei Niu --- build/Makefile | 5 + rpc/jsonrpc/go-client/conf/dubbogo.yml | 4 ++-- rpc/jsonrpc/go-server/conf/dubbogo.yml | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/build/Makefile b/build/Makefile index 348c6d6f..e658f086 100644 --- a/build/Makefile +++ b/build/Makefile @@ -43,13 +43,10 @@ export GONOPROXY ?= **.gitee.com** OS := $(shell uname) ifeq ($(OS), Linux) export GOOS ?= linux - export DOCKER_HOST_IP = $(shell ifconfig enp3s0 | grep inet | grep -v inet6 | awk '{print $$2}') else ifeq ($(OS), Darwin) export GOOS ?= darwin - export DOCKER_HOST_IP = $(shell ifconfig en0 | grep inet | grep -v inet6 | awk '{print $$2}') else export GOOS ?= windows - export DOCKER_HOST_IP = $(shell ifconfig en0 | grep inet | grep -v inet6 | awk '{print $$2}') endif ifeq ($(GOOS), windows) @@ -97,7 +94,7 @@ build: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) .PHONY: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME): $(info > Buiding application binary: $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME)) - @CGO_ENABLED=$(CGO) GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(GCFLAGS) -ldflags=$(LDFLAGS) -i -o $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) $(SOURCES) + @CGO_ENABLED=$(CGO) GOOS=$(GOOS) GOARCH=$(GOARCH) go build $(GCFLAGS) -ldflags=$(LDFLAGS) -o $(OUT_DIR)/$(PROJECT_NAME)$(EXT_NAME) $(SOURCES) ## docker-health-check: check services health on docker .PHONY: docker-health-check diff --git a/rpc/jsonrpc/go-client/conf/dubbogo.yml b/rpc/jsonrpc/go-client/conf/dubbogo.yml index 584d6a1b..10657746 100644 --- a/rpc/jsonrpc/go-client/conf/dubbogo.yml +++ b/rpc/jsonrpc/go-client/conf/dubbogo.yml @@ -18,12 +18,12 @@ dubbo: UserProvider1: protocol: jsonrpc version: 2.0 -interface: org.apache.dubbo.samples.UserProvider +interface: org.apache.dubbo.samples.UserProvider1 UserProvider2: protocol: jsonrpc version: 2.0 group: as -interface: org.apache.dubbo.samples.UserProvider +interface: org.apache.dubbo.samples.UserProvider2 logger: zap-config: level: info \ No newline at end of file diff --git a/rpc/jsonrpc/go-server/conf/dubbogo.yml b/rpc/jsonrpc/go-server/conf/dubbogo.yml index 1c01ba32..e823b81a 100644 --- a/rpc/jsonrpc/go-server/conf/dubbogo.yml +++ b/rpc/jsonrpc/go-server/conf/dubbogo.yml @@ -19,10 +19,10 @@ dubbo: UserProvider: interface: org.apache.dubbo.samples.UserProvider UserProvider1: -interface: org.apache.dubbo.samples.UserProvider +interface: org.apache.dubbo.samples.UserProvider1 version: 2.0 UserProvider2: -interface: org.apache.dubbo.samples.UserProvider +interface: org.apache.dubbo.samples.UserProvider2 version: 2.0 group: as logger:
[dubbo-go] branch revert-2279-3.1 created (now 219c2b5ff)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-2279-3.1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 219c2b5ff Revert "fix:Modify the comment syntax problem after the ci problem is fixed (#2279)" No new revisions were added by this update.
[dubbo-go-samples] branch master updated (66e369fc -> c24ddfbb)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from 66e369fc feat: token filter & config merge integrate test (#552) add 28678770 Revert "feat: token filter & config merge integrate test (#552)" new c24ddfbb Merge pull request #553 from apache/revert-552-integration_test_0402 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../config-merge/tests/integration/main_test.go| 41 -- .../config-merge/tests/integration/merge_test.go | 41 -- .../filter/token/tests/integration/main_test.go| 41 -- .../filter/token/tests/integration/token_test.go | 41 -- start_integrate_test.sh| 2 -- 5 files changed, 166 deletions(-) delete mode 100644 integrate_test/config-api/config-merge/tests/integration/main_test.go delete mode 100644 integrate_test/config-api/config-merge/tests/integration/merge_test.go delete mode 100644 integrate_test/filter/token/tests/integration/main_test.go delete mode 100644 integrate_test/filter/token/tests/integration/token_test.go
[dubbo-go-samples] 01/01: Merge pull request #553 from apache/revert-552-integration_test_0402
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git commit c24ddfbb8f8de4a0d2c88bc125bca1da44b094a1 Merge: 66e369fc 28678770 Author: Xuewei Niu AuthorDate: Wed Apr 5 16:28:05 2023 +0800 Merge pull request #553 from apache/revert-552-integration_test_0402 Revert "feat: token filter & config merge integrate test" .../config-merge/tests/integration/main_test.go| 41 -- .../config-merge/tests/integration/merge_test.go | 41 -- .../filter/token/tests/integration/main_test.go| 41 -- .../filter/token/tests/integration/token_test.go | 41 -- start_integrate_test.sh| 2 -- 5 files changed, 166 deletions(-)
[dubbo-go-samples] 01/01: Revert "feat: token filter & config merge integrate test (#552)"
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch revert-552-integration_test_0402 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git commit 286787702b86545d7cf672543db604193bc94d33 Author: Xuewei Niu AuthorDate: Wed Apr 5 16:26:52 2023 +0800 Revert "feat: token filter & config merge integrate test (#552)" This reverts commit 66e369fc7adbf798dd1360f3946a168b62be4f96. --- .../config-merge/tests/integration/main_test.go| 41 -- .../config-merge/tests/integration/merge_test.go | 41 -- .../filter/token/tests/integration/main_test.go| 41 -- .../filter/token/tests/integration/token_test.go | 41 -- start_integrate_test.sh| 2 -- 5 files changed, 166 deletions(-) diff --git a/integrate_test/config-api/config-merge/tests/integration/main_test.go b/integrate_test/config-api/config-merge/tests/integration/main_test.go deleted file mode 100644 index fb272bf4.. --- a/integrate_test/config-api/config-merge/tests/integration/main_test.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package integration - -import ( - "testing" -) - -import ( - "dubbo.apache.org/dubbo-go/v3/config" - _ "dubbo.apache.org/dubbo-go/v3/imports" -) - -import ( - "github.com/apache/dubbo-go-samples/api" -) - -var userProvider = &api.GreeterClientImpl{} - -func TestMain(m *testing.M) { - config.SetConsumerService(userProvider) - err := config.Load() - if err != nil { - panic(err) - } -} diff --git a/integrate_test/config-api/config-merge/tests/integration/merge_test.go b/integrate_test/config-api/config-merge/tests/integration/merge_test.go deleted file mode 100644 index 505c21b1.. --- a/integrate_test/config-api/config-merge/tests/integration/merge_test.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package integration - -import ( - "context" - "testing" -) - -import ( - "github.com/stretchr/testify/assert" -) - -import ( - "github.com/apache/dubbo-go-samples/api" -) - -func TestToken(t *testing.T) { - user, err := userProvider.SayHello(context.TODO(), &api.HelloRequest{Name: "dubbo-go"}) - - assert.Nil(t, err) - assert.Equal(t, "Hello dubbo-go", user.Name) - assert.Equal(t, "12345", user.Id) - assert.Equal(t, 21, user.Age) - -} diff --git a/integrate_test/filter/token/tests/integration/main_test.go b/integrate_test/filter/token/tests/integration/main_test.go deleted file mode 100644 index fb272bf4.. --- a/integrate_test/filter/token/tests/integration/main_test.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - *
[dubbo-go-samples] branch revert-552-integration_test_0402 created (now 28678770)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-552-integration_test_0402 in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git at 28678770 Revert "feat: token filter & config merge integrate test (#552)" This branch includes the following new commits: new 28678770 Revert "feat: token filter & config merge integrate test (#552)" The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo-go] branch release-3.0 updated: [3.0] ci: Fix CI failures after branch adjustment (#2287)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch release-3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/release-3.0 by this push: new 4cc0c2a93 [3.0] ci: Fix CI failures after branch adjustment (#2287) 4cc0c2a93 is described below commit 4cc0c2a93f15e3fc75307f8c95de368991d25325 Author: Xuewei Niu AuthorDate: Tue Apr 4 14:16:17 2023 +0800 [3.0] ci: Fix CI failures after branch adjustment (#2287) This PR backports CI settings to the 3.0 branch, and formats the code by the 1.20 `gofmt`. Go formatter whose version is above 1.19 formats comments as well, see: https://go.dev/blog/go1.19. Fixes: #2281 Signed-off-by: Xuewei Niu --- .github/workflows/codeql-analysis.yml | 6 +- .github/workflows/github-actions.yml | 46 +- .github/workflows/golangci-lint.yml| 2 +- common/constant/key.go | 2 +- config/config_center_config.go | 5 +- config/config_loader.go| 3 +- config/graceful_shutdown.go| 2 +- config/metadata_report_config.go | 1 - config/reference_config_test.go| 666 + config/registry_config.go | 5 +- filter/tps/filter.go | 23 +- filter/tps_limiter.go | 13 +- metadata/mapping/service_name_mapping.go | 2 +- protocol/dubbo3/reflection/serverreflection.go | 1 - protocol/invoker.go| 3 +- protocol/jsonrpc/http_test.go | 240 - protocol/protocol.go | 4 +- protocol/result.go | 2 +- proxy/proxy.go | 7 +- remoting/etcdv3/client.go | 2 +- xds/balancer/clusterresolver/configbuilder.go | 46 +- xds/balancer/priority/balancer_priority.go | 27 +- xds/balancer/ringhash/ringhash.go | 5 +- xds/client/controller/transport.go | 8 +- xds/client/controller/version/v2/client.go | 8 +- xds/client/controller/version/v3/client.go | 8 +- xds/client/resource/filter_chain.go| 10 +- xds/client/resource/matcher.go | 18 +- xds/credentials/cert_manager.go| 10 +- xds/credentials/certprovider/distributor.go| 10 +- xds/credentials/token_provider.go | 2 +- xds/server/conn_wrapper.go | 14 +- xds/utils/balancergroup/balancergroup.go | 16 +- xds/utils/grpclog/grpclog.go | 2 +- xds/utils/grpcutil/method.go | 1 - xds/utils/hierarchy/hierarchy.go | 31 +- xds/utils/serviceconfig/serviceconfig.go | 8 +- 37 files changed, 640 insertions(+), 619 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2dc1285f7..cd530488f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,12 +2,10 @@ name: "CodeQL" on: push: -branches: [master, ] +branches: "*" pull_request: # The branches below must be a subset of the branches above -branches: [master] - schedule: -- cron: '0 4 * * 5' +branches: "*" permissions: contents: read diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e35d59c92..35616155b 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -2,7 +2,7 @@ name: CI on: push: -branches: [master, develop, "1.5", "3.0"] +branches: "*" pull_request: branches: "*" @@ -21,19 +21,15 @@ jobs: os: - ubuntu-latest -env: - DING_TOKEN: ${{ secrets.DING_TOKEN }} - DING_SIGN: ${{ secrets.DING_SIGN }} - steps: -- name: Set up Go ${{ matrix.go_version }} +- name: Setup Go ${{ matrix.go_version }} uses: actions/setup-go@v3 with: go-version: ${{ matrix.go_version }} id: go -- name: Check out code into the Go module directory +- name: Checkout uses: actions/checkout@v3 - name: Cache dependencies @@ -47,18 +43,18 @@ jobs: restore-keys: | ${{ runner.os }}-go- -- name: Merge base +- name: Merge code into the upstream if: ${{ github.event_name == 'pull_request' }} run: | -git fetch origin 3.0 -git checkout -b 3.0 origin/3.0 +git fetch origin $GITHUB_BASE_REF +git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF git remote add devrepo https://github.com/${{github.event.pull_request.head.repo.full_name}}.git
[dubbo-go] branch main updated (3c831fbaa -> a6339462b)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go.git from 3c831fbaa fix conflict add a6339462b ci: Fix CI failures after branch adjustment (#2280) No new revisions were added by this update. Summary of changes: .github/workflows/codeql-analysis.yml | 6 +- .github/workflows/github-actions.yml | 48 +- .github/workflows/golangci-lint.yml| 2 +- common/constant/key.go | 2 +- common/url.go | 2 +- config/config_center_config.go | 5 +- config/config_loader.go| 3 +- config/graceful_shutdown.go| 2 +- config/metadata_report_config.go | 1 - config/reference_config_test.go| 666 + config/registry_config.go | 5 +- filter/tps/filter.go | 23 +- filter/tps_limiter.go | 13 +- metadata/mapping/service_name_mapping.go | 2 +- protocol/dubbo3/reflection/serverreflection.go | 1 - protocol/invoker.go| 3 +- protocol/jsonrpc/http_test.go | 240 - protocol/protocol.go | 4 +- protocol/result.go | 2 +- proxy/proxy.go | 7 +- remoting/etcdv3/client.go | 2 +- xds/balancer/clusterresolver/configbuilder.go | 46 +- xds/balancer/priority/balancer_priority.go | 27 +- xds/balancer/ringhash/ringhash.go | 5 +- xds/client/controller/transport.go | 8 +- xds/client/controller/version/v2/client.go | 8 +- xds/client/controller/version/v3/client.go | 8 +- xds/client/resource/filter_chain.go| 10 +- xds/client/resource/matcher.go | 18 +- xds/credentials/cert_manager.go| 10 +- xds/credentials/certprovider/distributor.go| 10 +- xds/credentials/token_provider.go | 2 +- xds/server/conn_wrapper.go | 14 +- xds/utils/balancergroup/balancergroup.go | 16 +- xds/utils/grpclog/grpclog.go | 2 +- xds/utils/grpcutil/method.go | 1 - xds/utils/hierarchy/hierarchy.go | 31 +- xds/utils/serviceconfig/serviceconfig.go | 8 +- 38 files changed, 642 insertions(+), 621 deletions(-)
[dubbo-go] branch 3.0 updated: tablewrite cli show (#2237)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0 by this push: new 60127ccfc tablewrite cli show (#2237) 60127ccfc is described below commit 60127ccfc19706bbd5cf0e698441efc33ef86521 Author: Leo Shen <694963...@qq.com> AuthorDate: Thu Mar 16 13:04:44 2023 +0800 tablewrite cli show (#2237) --- tools/dubbogo-cli/cmd/show.go | 15 +++ tools/dubbogo-cli/go.mod | 35 +-- tools/dubbogo-cli/go.sum | 3 ++- 3 files changed, 14 insertions(+), 39 deletions(-) diff --git a/tools/dubbogo-cli/cmd/show.go b/tools/dubbogo-cli/cmd/show.go index 61426386b..991cbe5d1 100644 --- a/tools/dubbogo-cli/cmd/show.go +++ b/tools/dubbogo-cli/cmd/show.go @@ -20,10 +20,13 @@ package cmd import ( "fmt" "log" + "os" + "strings" ) import ( "github.com/spf13/cobra" + "github.com/olekukonko/tablewriter" ) import ( @@ -68,6 +71,9 @@ func show(cmd *cobra.Command, _ []string) { panic(err) } + table := tablewriter.NewWriter(os.Stdout) + table.SetHeader([]string{"Interface", "Method"}) + if registry != "" { registryFactory, ok := metadata.GetFactory(registry) if !ok { @@ -81,9 +87,9 @@ func show(cmd *cobra.Command, _ []string) { fmt.Printf("==\n") fmt.Printf("Registry:\n") for k, v := range methodsMap { - fmt.Printf("interface: %s\n", k) - fmt.Printf("methods: %v\n", v) + table.Append([]string{k, strings.Join(v, ", ")}) } + table.Render() fmt.Printf("==\n") } @@ -100,9 +106,10 @@ func show(cmd *cobra.Command, _ []string) { fmt.Printf("==\n") fmt.Printf("MetadataCenter:\n") for k, v := range methodsMap { - fmt.Printf("interface: %s\n", k) - fmt.Printf("methods: %v\n", v) + table.Append([]string{k, strings.Join(v, ", ")}) } + table.Render() fmt.Printf("==\n") } } + diff --git a/tools/dubbogo-cli/go.mod b/tools/dubbogo-cli/go.mod index 9c29612ea..3f7af722f 100644 --- a/tools/dubbogo-cli/go.mod +++ b/tools/dubbogo-cli/go.mod @@ -15,39 +15,6 @@ require ( ) require ( - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect - github.com/Workiva/go-datastructures v1.0.52 // indirect - github.com/apache/dubbo-getty v1.4.7 // indirect - github.com/buger/jsonparser v1.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect - github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/go-ole/go-ole v1.2.4 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/gorilla/websocket v1.4.2 // indirect - github.com/hashicorp/hcl v1.0.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/jinzhu/copier v0.3.5 // indirect - github.com/k0kubun/pp v3.0.1+incompatible // indirect - github.com/magiconair/properties v1.8.5 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/natefinch/lumberjack v2.0.0+incompatible // indirect - github.com/pelletier/go-toml v1.9.4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b // indirect - github.com/shirou/gopsutil v3.20.11+incompatible // indirect - github.com/spf13/afero v1.6.0 // indirect - github.com/spf13/cast v1.4.1 // indirect - github.com/spf13/jwalterweatherman v1.1.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/subosito/gotenv v1.2.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.21.0 // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/text v0.3.7 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + github.com/olekukonko/tablewriter v0.0.0-2017014234-a0225b3f23b5 gopkg.in/yaml.v3 v3.0.0 // indirect ) diff --git
[dubbo-go] branch 3.0 updated: [ISSUE #2216] fix register instance protocol info to polaris when use tripe (#2238)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0 by this push: new a5ebff74b [ISSUE #2216] fix register instance protocol info to polaris when use tripe (#2238) a5ebff74b is described below commit a5ebff74b6742ba7f90f25e7525dc29d02cd9252 Author: liaochuntao AuthorDate: Thu Mar 16 13:04:06 2023 +0800 [ISSUE #2216] fix register instance protocol info to polaris when use tripe (#2238) * fix:issue #2216 * fix:issue #2216 --- common/url.go | 2 ++ config/metric_config.go | 1 + registry/polaris/registry.go | 2 +- registry/polaris/service_discovery.go | 11 +++ registry/polaris/utils.go | 4 remoting/zookeeper/listener.go| 5 + 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/common/url.go b/common/url.go index e0ef856f5..21a68f629 100644 --- a/common/url.go +++ b/common/url.go @@ -36,7 +36,9 @@ import ( gxset "github.com/dubbogo/gost/container/set" "github.com/google/uuid" + "github.com/jinzhu/copier" + perrors "github.com/pkg/errors" ) diff --git a/config/metric_config.go b/config/metric_config.go index 509907007..14d7b7271 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -19,6 +19,7 @@ package config import ( "github.com/creasty/defaults" + "github.com/dubbogo/gost/log/logger" "github.com/pkg/errors" diff --git a/registry/polaris/registry.go b/registry/polaris/registry.go index 0533f7729..d156e8ae0 100644 --- a/registry/polaris/registry.go +++ b/registry/polaris/registry.go @@ -260,7 +260,7 @@ func createRegisterParam(url *common.URL, serviceName string) *api.InstanceRegis Service: serviceName, Host: url.Ip, Port: port, - Protocol: &protocolForDubboGO, + Protocol: &url.Protocol, Version: &ver, Metadata: metadata, }, diff --git a/registry/polaris/service_discovery.go b/registry/polaris/service_discovery.go index bb460875a..4bd3e0144 100644 --- a/registry/polaris/service_discovery.go +++ b/registry/polaris/service_discovery.go @@ -317,9 +317,12 @@ func (polaris *polarisServiceDiscovery) String() string { func convertToRegisterInstance(namespace string, instance registry.ServiceInstance) *api.InstanceRegisterRequest { - health := instance.IsHealthy() - isolate := instance.IsEnable() - ttl := 5 + var ( + health = instance.IsHealthy() + isolate = instance.IsEnable() + ttl = 5 + protocolVal = string(constant.Dubbo) + ) return &api.InstanceRegisterRequest{ InstanceRegisterRequest: model.InstanceRegisterRequest{ @@ -327,7 +330,7 @@ func convertToRegisterInstance(namespace string, instance registry.ServiceInstan Namespace: namespace, Host: instance.GetHost(), Port: instance.GetPort(), - Protocol: &protocolForDubboGO, + Protocol: &protocolVal, Metadata: instance.GetMetadata(), Healthy: &health, Isolate: &isolate, diff --git a/registry/polaris/utils.go b/registry/polaris/utils.go index 39b50a3c5..82e06c9c6 100644 --- a/registry/polaris/utils.go +++ b/registry/polaris/utils.go @@ -30,10 +30,6 @@ import ( "dubbo.apache.org/dubbo-go/v3/registry" ) -var ( - protocolForDubboGO string = "dubbo" -) - type PolarisInstanceInfo struct { instance registry.ServiceInstance url *common.URL diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index 332accdf4..498fc3309 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -23,13 +23,18 @@ import ( "sync" "time" ) + import ( "github.com/dubbogo/go-zookeeper/zk" + gxzookeeper "github.com/dubbogo/gost/database/kv/zk" "github.com/dubbogo/gost/log/logger" + perrors "github.com/pkg/errors" + uatomic "go.uber.org/atomic" ) + import ( "dubbo.apache.org/dubbo-go/v3/common" "dubbo.apache.org/dubbo-go/v3/common/constant"
[dubbo-go] branch 3.0 updated: feat: expose TLSConfig for config api (#2245)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0 by this push: new b4ad6a383 feat: expose TLSConfig for config api (#2245) b4ad6a383 is described below commit b4ad6a3831ebd5f61fead4cb20505641fc5e4865 Author: Sekfung Lau AuthorDate: Wed Mar 15 13:47:49 2023 +0800 feat: expose TLSConfig for config api (#2245) * feat: expose TLSConfig for config api Signed-off-by: sekfung * fix: integration test Signed-off-by: sekfung * fix: add license header Signed-off-by: sekfung - Signed-off-by: sekfung --- common/constant/key.go| 1 + config/root_config.go | 13 config/tls_config.go | 52 +++ config/tls_config_test.go | 45 4 files changed, 111 insertions(+) diff --git a/common/constant/key.go b/common/constant/key.go index 68c7d4526..1c8737ea9 100644 --- a/common/constant/key.go +++ b/common/constant/key.go @@ -234,6 +234,7 @@ const ( LoggerConfigPrefix = "dubbo.logger" CustomConfigPrefix = "dubbo.custom" ProfilesConfigPrefix = "dubbo.profiles" + TLSConfigPrefix= "dubbo.tls_config" ) const ( diff --git a/config/root_config.go b/config/root_config.go index ee0387575..d621dd4a0 100644 --- a/config/root_config.go +++ b/config/root_config.go @@ -106,6 +106,13 @@ func GetShutDown() *ShutdownConfig { return NewShutDownConfigBuilder().Build() } +func GetTLSConfig() *TLSConfig { + if err := check(); err == nil && rootConfig.TLSConfig != nil { + return rootConfig.TLSConfig + } + return NewTLSConfigBuilder().Build() +} + // getRegistryIds get registry ids func (rc *RootConfig) getRegistryIds() []string { ids := make([]string, 0) @@ -225,6 +232,7 @@ func newEmptyRootConfig() *RootConfig { Logger: NewLoggerConfigBuilder().Build(), Custom: NewCustomConfigBuilder().Build(), Shutdown: NewShutDownConfigBuilder().Build(), + TLSConfig: NewTLSConfigBuilder().Build(), } return newRootConfig } @@ -322,6 +330,11 @@ func (rb *RootConfigBuilder) SetShutDown(shutDownConfig *ShutdownConfig) *RootCo return rb } +func (rb *RootConfigBuilder) SetTLSConfig(tlsConfig *TLSConfig) *RootConfigBuilder { + rb.rootConfig.TLSConfig = tlsConfig + return rb +} + func (rb *RootConfigBuilder) Build() *RootConfig { return rb.rootConfig } diff --git a/config/tls_config.go b/config/tls_config.go index 018f61af2..97c79ec2c 100644 --- a/config/tls_config.go +++ b/config/tls_config.go @@ -23,6 +23,10 @@ import ( "io/ioutil" ) +import ( + "dubbo.apache.org/dubbo-go/v3/common/constant" +) + // TLSConfig tls config type TLSConfig struct { CACertFilestring `yaml:"ca-cert-file" json:"ca-cert-file" property:"ca-cert-file"` @@ -31,6 +35,10 @@ type TLSConfig struct { TLSServerName string `yaml:"tls-server-name" json:"tls-server-name" property:"tls-server-name"` } +func (t *TLSConfig) Prefix() string { + return constant.TLSConfigPrefix +} + // GetServerTlsConfig build server tls config from TLSConfig func GetServerTlsConfig(opt *TLSConfig) (*tls.Config, error) { //no TLS @@ -91,3 +99,47 @@ func GetClientTlsConfig(opt *TLSConfig) (*tls.Config, error) { } return cfg, err } + +type TLSConfigBuilder struct { + tlsConfig *TLSConfig +} + +func NewTLSConfigBuilder() *TLSConfigBuilder { + return &TLSConfigBuilder{} +} + +func (tcb *TLSConfigBuilder) SetCACertFile(caCertFile string) *TLSConfigBuilder { + if tcb.tlsConfig == nil { + tcb.tlsConfig = &TLSConfig{} + } + tcb.tlsConfig.CACertFile = caCertFile + return tcb +} + +func (tcb *TLSConfigBuilder) SetTLSCertFile(tlsCertFile string) *TLSConfigBuilder { + if tcb.tlsConfig == nil { + tcb.tlsConfig = &TLSConfig{} + } + tcb.tlsConfig.TLSCertFile = tlsCertFile + return tcb +} + +func (tcb *TLSConfigBuilder) SetTLSKeyFile(tlsKeyFile string) *TLSConfigBuilder { + if tcb.tlsConfig == nil { + tcb.tlsConfig = &TLSConfig{} + } + tcb.tlsConfig.TLSKeyFile = tlsKeyFile + return tcb +} + +func (tcb *TLSConfigBuilder) SetTLSServerName(tlsServerName string) *TLSConfigBuilder { + if tcb.tlsConfig == nil { + tcb.tlsConfig = &TLSConfig{} + } + tcb.tlsConfig.TLSServerName = tlsServerName + return tcb +} + +func (tcb *TLSConfigB
[dubbo-go-samples] branch master updated (b42fbc48 -> e74eeacc)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git from b42fbc48 Build(deps): bump golang.org/x/net in /mesh/go-client (#514) new 91cd7bf2 feat: tls integrate test new 8d072649 feat: tls integrate test new ce9e7d1e feat: tls integrate test new d0316636 Merge branch 'master' into add_integrate_test new eef9558a feat: registry-all integrate test new fb8f2a00 feat: protobuf v2 integrate test new e0be6539 Merge branch 'master' into add_integrate_test new 7420cf01 feat: protobuf v2 integrate test new 230e944d feat: tls integrate test new 81a8aab0 feat: tls integrate test new 99da3be9 fix: Fix grammatical errors new e74eeacc Merge pull request #523 from ZLBer/add_integrate_test The 649 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../all/nacos/tests/integration/greeter_test.go| 5 ++- .../all/nacos/tests/integration/main_test.go | 2 + .../zookeeper/tests/integration/greeter_test.go| 5 ++- .../all/zookeeper/tests/integration/main_test.go | 2 + .../triple/pb2/tests/integration/greeter_test.go} | 47 ++ .../triple/pb2}/tests/integration/main_test.go | 8 ++-- .../tls/grpc/tests/integration/greeter_test.go | 1 + start_integrate_test.sh| 6 +++ tls/dubbo/go-client/conf/dubbogo.yml | 6 +-- tls/dubbo/go-server/conf/dubbogo.yml | 6 +-- tls/grpc/go-client/conf/dubbogo.yml| 6 +-- tls/grpc/go-server/conf/dubbogo.yml| 6 +-- tls/triple/go-client/conf/dubbogo.yml | 6 +-- tls/triple/go-server/conf/dubbogo.yml | 6 +-- 14 files changed, 63 insertions(+), 49 deletions(-) copy integrate_test/{helloworld/tests/integration/helloworld_test.go => rpc/triple/pb2/tests/integration/greeter_test.go} (58%) copy integrate_test/{registry/servicediscovery/nacos => rpc/triple/pb2}/tests/integration/main_test.go (89%)
[dubbo-go] tag v3.0.5 created (now 6deedc3a8)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to tag v3.0.5 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 6deedc3a8 (commit) No new revisions were added by this update.
svn commit: r59918 - in /dev/dubbo/dubbo-go/v3.0.5-rc1: dubbo-go-v3.0.5-rc1-src.tar.gz dubbo-go-v3.0.5-rc1-src.tar.gz.asc dubbo-go-v3.0.5-rc1-src.tar.gz.sha512
Author: justxuewei Date: Mon Feb 6 04:32:26 2023 New Revision: 59918 Log: Release dubbo-go v3.0.5-rc1 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz == Binary files - no diff available. Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Mon Feb 6 04:32:26 2023 @@ -1,14 +1,14 @@ -BEGIN PGP SIGNATURE- -iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPggbsWHGp1c3R4dWV3 -ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNQHaC/47ovgmUyygxenPeOjUgpHrdM2P -W4CKeHftbSyJoedPR5/IDfNhZQny/lJ0cKcucma6LSFcZ5IgsJqTF0pkNZKGHpIl -cWjxRZIcC/SiiF87jLgCDQo80WZBNrdHOKzzqWGj+C8QKcIBBPdGJxZ+CF3KTVFR -xOqailGh8LwVyD9ZIUEnNlqWvtCeyvhwp3mhoN0q0lnosJGIRNt6hWgQaZOFC1Iy -3wufF7F5dguqs2w6VUVVX3cJthWouq+Ic2u0eIQkA3h8JzG11ZHNOXtSKhuhzp0g -03Jlj6wgRi4J4tWb1igvXFqF38fv79ODSrNqMWIPVsOmGtGhaH67LRez9cYNmGXR -rCwDnNW1qr6BszD486voX0Qzu7US92sCpQQxHGLU4ygzuNz3sznhO/1icOKmV9ug -ehNEFi/xbOfKkvf4V8Jeasw2u+k4Dicy0NX3LKL+WY9fDWI6jln4jUEFnrlFO6QB -wvrWEeTTvtKqD3RqyS8U3Lc9+83MlzwPc7EaOMg= -=LDGH +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPggtcWHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNTs/DACTL+x1eoSwTYPpCE3Cm80UsNVc +fs3hqB/oaKRWmJgX++aHW4jvx16NU4UseJ6L89iABqu8OKtECx26GoESKbvm8OEm +SCfUgTaWvk6Xoqc7fYnB0aCDdFknO6hCZZDwTUr8ND4alATFsgbe1I3fJCLRJ5N4 +6p+p0mCl/oAbl46vmb+czoPJhaeDvJ3ngTMZZljydyrqxR9b7oPSiW1msOlPDXeP ++rVTvGxN6xu6Psyv1OW7y2lzPu78djr6C2boTRuTbvbGyDgfWPCOdHK9aQ/4tia7 +Sidcw0d/VTFhwLruw9DFzsLvsLsqNHq/Sv0Sw3fxQyqYwa8ljYP5V2Q0WZ8ByHJr +caIowLLQ3rIyo6xgcwnU8V9cTOrOTTDZhpUMvEQYZwOerjDmTw/HP/wnTUue+PNT +IThXoOmVzBH8oEqCdZ2Yuh5HCE9U1QRQuP5CnqGsH/AecvD0Gd1dFDrX65H4/HK8 +vtdoBd7UJRgjpqBkz318DEK/0cbcTXyuYqQfKUM= +=OC8P -END PGP SIGNATURE- Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Mon Feb 6 04:32:26 2023 @@ -1 +1 @@ -4b628903eddc80174f2f13f1af1e906739e5cc55691119c369f140d2529144075f974ef415ca156dde1889f7cfd68aa084cde06bab83005bc8e99463ae33a4ae dubbo-go-v3.0.5-rc1-src.tar.gz +194c56be42b57f84bd780919d5fc1226e50a8d40fd51b505940f0031efc343f8639eb1cdd9c4cc55a91d3360761586e37e396af0ea086f1d8eefdf1db6692027 dubbo-go-v3.0.5-rc1-src.tar.gz
svn commit: r59917 - /dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc
Author: justxuewei Date: Mon Feb 6 04:28:23 2023 New Revision: 59917 Log: Release dubbo-go v3.0.5-rc1 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Mon Feb 6 04:28:23 2023 @@ -1,14 +1,14 @@ -BEGIN PGP SIGNATURE- -iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPgeBUWHGp1c3R4dWV3 -ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNWe0C/9c6//sv+uroKQ2OQmYwnyqDfTA -OuONnKbGpeHOrKZjl0KEgespRTz5nZ9OnrRtDqZfBY35RGzyeFYSVNU3HaN+wIxG -lUMum/2UbtHcByxNvuId7MADW9anyQF7vDWG/T9HcNZaYMSpXKNnMwd9NmDXzsu3 -zPIQ/q8KWKKUTIrtTHVl1A0ZFImA8u9fYKfx/McTlFB8m5kfSn0liADryeq7bor3 -l8349o+3dyAaHYsQ8lQqtgTQuaJI1q+EiryLSSSb9m3k0a6RWIGFgo6QLg4ftCDG -QuXYV1QBvnI7fwxFmQKvj4s6iDeEsB4xs84vAYi7saMWs/hQ2gfogMJKo3m9plVE -56jtUFVbjJkwtok4R2FWIH8FjIT2aS5s0S3UiyA0yCmBhWnogdPVr0KcoDbCTy5Z -/oJ6wq1RctrlpfsLCjzj/lUsErEKM0wesH3dyCkljN3A7Mj0byA412IkNMnJp6xS -L5ZGDwjuYi3WAqAZwHhPysAEiC5y7AcMfhUm8S0= -=yJBX +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPggbsWHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNQHaC/47ovgmUyygxenPeOjUgpHrdM2P +W4CKeHftbSyJoedPR5/IDfNhZQny/lJ0cKcucma6LSFcZ5IgsJqTF0pkNZKGHpIl +cWjxRZIcC/SiiF87jLgCDQo80WZBNrdHOKzzqWGj+C8QKcIBBPdGJxZ+CF3KTVFR +xOqailGh8LwVyD9ZIUEnNlqWvtCeyvhwp3mhoN0q0lnosJGIRNt6hWgQaZOFC1Iy +3wufF7F5dguqs2w6VUVVX3cJthWouq+Ic2u0eIQkA3h8JzG11ZHNOXtSKhuhzp0g +03Jlj6wgRi4J4tWb1igvXFqF38fv79ODSrNqMWIPVsOmGtGhaH67LRez9cYNmGXR +rCwDnNW1qr6BszD486voX0Qzu7US92sCpQQxHGLU4ygzuNz3sznhO/1icOKmV9ug +ehNEFi/xbOfKkvf4V8Jeasw2u+k4Dicy0NX3LKL+WY9fDWI6jln4jUEFnrlFO6QB +wvrWEeTTvtKqD3RqyS8U3Lc9+83MlzwPc7EaOMg= +=LDGH -END PGP SIGNATURE-
svn commit: r59916 - in /dev/dubbo/dubbo-go/v3.0.5-rc1: dubbo-go-v3.0.5-rc1-src.tar.gz dubbo-go-v3.0.5-rc1-src.tar.gz.asc dubbo-go-v3.0.5-rc1-src.tar.gz.sha512
Author: justxuewei Date: Mon Feb 6 03:47:05 2023 New Revision: 59916 Log: Release dubbo-go v3.0.5-rc1 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz == Binary files - no diff available. Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Mon Feb 6 03:47:05 2023 @@ -1,14 +1,14 @@ -BEGIN PGP SIGNATURE- -iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPgdw4WHGp1c3R4dWV3 -ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNSAxDACWM8OWOBeCOnjCVu4lkEmrRe9p -14HTonwzGuqLQ3HEI5XHjszf2ZAgpI0l5hnciq4pMo6vyiTGRK1yaOYVt2LmkkWZ -Eg4T0sAg1nwL5AIsXzD6EUSm1DW4dm0OPvbSfPpZVhUN+wVl1fjyCrxG3Dw451AS -4kzGLaxTW5Eb8LAWJIXHwZDNCnLKseMZqbkPDsafsNdSMLp8V7SwIxvQRfQavPjf -zGn5a4NHEx/IDou018kMm8aGqUiagsBXNch1T66i83gOCHv3igzTsOhcCQLOQDnu -1iHjQwjYZds7Og+bMILUveMEM4BydAX5L/5xopy2uefmVE7ZNAkmBy05HVrhr5lo -UZ/AyU1oXhEZ4IAVtutRKK0Y/wzmKPuP31pD/wYm/QbgZrGLufTYu/09AYcftf4u -9e0+ocKNMLPlOVUYj9xDlMh0FhAyVDovD88AOcFiE/aPoI0vpkgUlrpm/pcUoWkc -yygANFaXgOI8vhm9RNvPPe70Twk3//WBLHQGWPI= -=U8BG +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPgeBUWHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNWe0C/9c6//sv+uroKQ2OQmYwnyqDfTA +OuONnKbGpeHOrKZjl0KEgespRTz5nZ9OnrRtDqZfBY35RGzyeFYSVNU3HaN+wIxG +lUMum/2UbtHcByxNvuId7MADW9anyQF7vDWG/T9HcNZaYMSpXKNnMwd9NmDXzsu3 +zPIQ/q8KWKKUTIrtTHVl1A0ZFImA8u9fYKfx/McTlFB8m5kfSn0liADryeq7bor3 +l8349o+3dyAaHYsQ8lQqtgTQuaJI1q+EiryLSSSb9m3k0a6RWIGFgo6QLg4ftCDG +QuXYV1QBvnI7fwxFmQKvj4s6iDeEsB4xs84vAYi7saMWs/hQ2gfogMJKo3m9plVE +56jtUFVbjJkwtok4R2FWIH8FjIT2aS5s0S3UiyA0yCmBhWnogdPVr0KcoDbCTy5Z +/oJ6wq1RctrlpfsLCjzj/lUsErEKM0wesH3dyCkljN3A7Mj0byA412IkNMnJp6xS +L5ZGDwjuYi3WAqAZwHhPysAEiC5y7AcMfhUm8S0= +=yJBX -END PGP SIGNATURE- Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Mon Feb 6 03:47:05 2023 @@ -1 +1 @@ -194c56be42b57f84bd780919d5fc1226e50a8d40fd51b505940f0031efc343f8639eb1cdd9c4cc55a91d3360761586e37e396af0ea086f1d8eefdf1db6692027 dubbo-go-v3.0.5-rc1-src.tar.gz +4b628903eddc80174f2f13f1af1e906739e5cc55691119c369f140d2529144075f974ef415ca156dde1889f7cfd68aa084cde06bab83005bc8e99463ae33a4ae dubbo-go-v3.0.5-rc1-src.tar.gz
svn commit: r59915 - in /dev/dubbo/dubbo-go/v3.0.5-rc1: dubbo-go-v3.0.5-rc1-src.tar.gz dubbo-go-v3.0.5-rc1-src.tar.gz.asc dubbo-go-v3.0.5-rc1-src.tar.gz.sha512
Author: justxuewei Date: Mon Feb 6 03:44:01 2023 New Revision: 59915 Log: Release dubbo-go v3.0.5-rc1 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz == Binary files - no diff available. Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Mon Feb 6 03:44:01 2023 @@ -1,14 +1,14 @@ -BEGIN PGP SIGNATURE- -iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPbsekWHGp1c3R4dWV3 -ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNRESDACXiz2/+Aut++VwfQapffqSoNkH -5OQ84pZ6DC8HFd1DkEgm9ezxsaZjuB9/ssLub80y9ewZY6dqGRsYMUnOZRW6UjAK -mcDN3VCRS/22krTkiG5kYI4LHwFCldjhSH0q08yh0jkPwQHLtGdrUBo+Exn6anL4 -3tqCXxovn8H1LsaVR/9N23yb0IeZaHyhCmjcVtVhNuD9P2wfoqmJY0m3xSgOAhlf -kbT8HHCJ1hsrEGAhGRgTqAHJBcjZw0iosbGqrhui03zn1hg54lEzNReZ+7nbZDD4 -3BX+6z4x9qJpVBqw8LCnrvhz1IpinpVZGnxIDoYzGMeSNjq90HX+TJUpOMn7dVkT -ymuDtxp/qe5h/+HI0JA0FNOTugp5z/t1KMyyGxLYUritCh7xaW5AadH9d3XUHSxB -XrEJXFbEkyyMWynC8YHanBcwFoDl5hhIPSx6DvRB35PqtMZaNS9bWGrPedepo1Ud -HnBiskAL8cEdfkIFlVOM+9/W+JMRQD8/NbmdBiw= -=ki4o +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPgdw4WHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNSAxDACWM8OWOBeCOnjCVu4lkEmrRe9p +14HTonwzGuqLQ3HEI5XHjszf2ZAgpI0l5hnciq4pMo6vyiTGRK1yaOYVt2LmkkWZ +Eg4T0sAg1nwL5AIsXzD6EUSm1DW4dm0OPvbSfPpZVhUN+wVl1fjyCrxG3Dw451AS +4kzGLaxTW5Eb8LAWJIXHwZDNCnLKseMZqbkPDsafsNdSMLp8V7SwIxvQRfQavPjf +zGn5a4NHEx/IDou018kMm8aGqUiagsBXNch1T66i83gOCHv3igzTsOhcCQLOQDnu +1iHjQwjYZds7Og+bMILUveMEM4BydAX5L/5xopy2uefmVE7ZNAkmBy05HVrhr5lo +UZ/AyU1oXhEZ4IAVtutRKK0Y/wzmKPuP31pD/wYm/QbgZrGLufTYu/09AYcftf4u +9e0+ocKNMLPlOVUYj9xDlMh0FhAyVDovD88AOcFiE/aPoI0vpkgUlrpm/pcUoWkc +yygANFaXgOI8vhm9RNvPPe70Twk3//WBLHQGWPI= +=U8BG -END PGP SIGNATURE- Modified: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 (original) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Mon Feb 6 03:44:01 2023 @@ -1 +1 @@ -6f0365bd766337bb6e62b876ebaf1fdda1d97afbd1edce4713ac3f00a45dbaaf3c0243408b791e25e94f8fd857ae0d0e32b2ece767c6e916bda41c4f6c952971 dubbo-go-v3.0.5-rc1-src.tar.gz +194c56be42b57f84bd780919d5fc1226e50a8d40fd51b505940f0031efc343f8639eb1cdd9c4cc55a91d3360761586e37e396af0ea086f1d8eefdf1db6692027 dubbo-go-v3.0.5-rc1-src.tar.gz
svn commit: r59861 - in /dev/dubbo/dubbo-go/v3.0.5-rc1: ./ dubbo-go-v3.0.5-rc1-src.tar.gz dubbo-go-v3.0.5-rc1-src.tar.gz.asc dubbo-go-v3.0.5-rc1-src.tar.gz.sha512
Author: justxuewei Date: Thu Feb 2 13:17:12 2023 New Revision: 59861 Log: Release dubbo-go v3.0.5-rc1 Added: dev/dubbo/dubbo-go/v3.0.5-rc1/ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz (with props) dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Added: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz == Binary file - no diff available. Propchange: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz -- svn:mime-type = application/octet-stream Added: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc (added) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.asc Thu Feb 2 13:17:12 2023 @@ -0,0 +1,14 @@ +-BEGIN PGP SIGNATURE- + +iQHKBAABCgA0FiEEj96JOo3lGEx/duy5uRhZhL99ZzUFAmPbsekWHGp1c3R4dWV3 +ZWlAYXBhY2hlLm9yZwAKCRC5GFmEv31nNRESDACXiz2/+Aut++VwfQapffqSoNkH +5OQ84pZ6DC8HFd1DkEgm9ezxsaZjuB9/ssLub80y9ewZY6dqGRsYMUnOZRW6UjAK +mcDN3VCRS/22krTkiG5kYI4LHwFCldjhSH0q08yh0jkPwQHLtGdrUBo+Exn6anL4 +3tqCXxovn8H1LsaVR/9N23yb0IeZaHyhCmjcVtVhNuD9P2wfoqmJY0m3xSgOAhlf +kbT8HHCJ1hsrEGAhGRgTqAHJBcjZw0iosbGqrhui03zn1hg54lEzNReZ+7nbZDD4 +3BX+6z4x9qJpVBqw8LCnrvhz1IpinpVZGnxIDoYzGMeSNjq90HX+TJUpOMn7dVkT +ymuDtxp/qe5h/+HI0JA0FNOTugp5z/t1KMyyGxLYUritCh7xaW5AadH9d3XUHSxB +XrEJXFbEkyyMWynC8YHanBcwFoDl5hhIPSx6DvRB35PqtMZaNS9bWGrPedepo1Ud +HnBiskAL8cEdfkIFlVOM+9/W+JMRQD8/NbmdBiw= +=ki4o +-END PGP SIGNATURE- Added: dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 == --- dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 (added) +++ dev/dubbo/dubbo-go/v3.0.5-rc1/dubbo-go-v3.0.5-rc1-src.tar.gz.sha512 Thu Feb 2 13:17:12 2023 @@ -0,0 +1 @@ +6f0365bd766337bb6e62b876ebaf1fdda1d97afbd1edce4713ac3f00a45dbaaf3c0243408b791e25e94f8fd857ae0d0e32b2ece767c6e916bda41c4f6c952971 dubbo-go-v3.0.5-rc1-src.tar.gz
[dubbo-go] tag v3.0.4 created (now 2e4e95853)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to tag v3.0.4 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 2e4e95853 (commit) No new revisions were added by this update.
[dubbo-go] tag v3.0.5-rc1 created (now 6deedc3a8)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to tag v3.0.5-rc1 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 6deedc3a8 (commit) No new revisions were added by this update.
[dubbo-go] branch 3.0 updated: docs: Update CHANGELOG for release v3.0.5 (#2198)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0 by this push: new 6deedc3a8 docs: Update CHANGELOG for release v3.0.5 (#2198) 6deedc3a8 is described below commit 6deedc3a88c99aa2877f70c7af5ac206e5f24d86 Author: Xuewei Niu AuthorDate: Thu Feb 2 13:46:21 2023 +0800 docs: Update CHANGELOG for release v3.0.5 (#2198) * docs: Update CHANGELOG for release v3.0.5 Signed-off-by: Xuewei Niu * docs: Append a missing change Signed-off-by: Xuewei Niu - Signed-off-by: Xuewei Niu --- CHANGELOG.md | 10 ++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee58202f7..b792acf82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Release Notes --- +## 3.0.5 + +### Bugfixes + +- [Fix: Consumers try to reconnect to the metadata service of offline providers infinitely](https://github.com/apache/dubbo-go/pull/2166) +- [Fix: Service discovery registry notify before return](https://github.com/apache/dubbo-go/pull/2168) +- [Fix: Do not launch Polaris governance capability if Polaris is not enabled](https://github.com/apache/dubbo-go/pull/2171) +- [Fix: Config of metrics enbale not works](https://github.com/apache/dubbo-go/pull/2180) +- [Fix: Replace assignment behavior with copy operation to avoid OOM](https://github.com/apache/dubbo-go/pull/2182) + ## 3.0.4 ### Features
[dubbo-go] branch master updated: sync: Merge the 3.0 branch into the master branch (#2201)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new 601a48119 sync: Merge the 3.0 branch into the master branch (#2201) 601a48119 is described below commit 601a481191c8cb7bbb6ab9bbbf8685cee2e3fc90 Author: Xuewei Niu AuthorDate: Wed Feb 1 14:19:08 2023 +0800 sync: Merge the 3.0 branch into the master branch (#2201) * 解决 consumer 不断重连已下线的 provider meta service 问题 (#2166) * registry type support all * fix test * set default to interface * use default protocol registry * fix unit test * use swith to judge * add registry support all test * Resolve registry name conflicts * fix ut err * fix https://github.com/apache/dubbo-go/issues/2159 * del front * del front Co-authored-by: bobtthp Co-authored-by: bob Co-authored-by: bobtthp Co-authored-by: bob * build(deps): bump github.com/hashicorp/vault/sdk from 0.6.0 to 0.6.2 (#2169) Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.0 to 0.6.2. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v0.6.0...v0.6.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault/sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix: service discovery registry notify before return (#2168) * Fix: service discovery registry notify before return * format import * modify notify url * add judge about the existence of instance's metadata revision * build(deps): bump github.com/knadh/koanf from 1.4.4 to 1.4.5 (#2179) Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](https://github.com/knadh/koanf/compare/v1.4.4...v1.4.5) --- updated-dependencies: - dependency-name: github.com/knadh/koanf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix: Replace assignment behavior with copy operation to avoid OOM problem (#2182) * build(deps): bump github.com/hashicorp/vault/sdk from 0.6.2 to 0.7.0 (#2185) Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.2 to 0.7.0. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v0.6.2...v0.7.0) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault/sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/nacos-group/nacos-sdk-go (#2183) Bumps [github.com/nacos-group/nacos-sdk-go](https://github.com/nacos-group/nacos-sdk-go) from 1.1.3 to 1.1.4. - [Release notes](https://github.com/nacos-group/nacos-sdk-go/releases) - [Commits](https://github.com/nacos-group/nacos-sdk-go/compare/v1.1.3...v1.1.4) --- updated-dependencies: - dependency-name: github.com/nacos-group/nacos-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump github.com/knadh/koanf from 1.4.5 to 1.5.0 (#2187) Bumps [github.com/knadh/koanf](https://github.com/knadh/koanf) from 1.4.5 to 1.5.0. - [Release notes](https://github.com/knadh/koanf/releases) - [Commits](https://github.com/knadh/koanf/compare/v1.4.5...v1.5.0) --- updated-dependencies: - dependency-name: github.com/knadh/koanf dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[b
[dubbo-go] branch master updated: Revert "[ISSUE #2172] Fix/polaris governance (#2171)" (#2200)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new f797b0fa4 Revert "[ISSUE #2172] Fix/polaris governance (#2171)" (#2200) f797b0fa4 is described below commit f797b0fa4d65c73b924aa53547c2816bb2ca5d85 Author: Xuewei Niu AuthorDate: Wed Feb 1 14:16:30 2023 +0800 Revert "[ISSUE #2172] Fix/polaris governance (#2171)" (#2200) This reverts commit c1a06982596e2d0c969ff59174e42bfe42430735. --- cluster/router/polaris/router.go| 19 + filter/polaris/limit/limiter.go | 6 -- go.mod | 2 +- go.sum | 8 +++ metadata/service/local/service_proxy.go | 2 -- metadata/service/local_service.go | 7 +- remoting/polaris/builder.go | 38 +++-- 7 files changed, 24 insertions(+), 58 deletions(-) diff --git a/cluster/router/polaris/router.go b/cluster/router/polaris/router.go index d29636dd7..ab71ab3dd 100644 --- a/cluster/router/polaris/router.go +++ b/cluster/router/polaris/router.go @@ -53,12 +53,6 @@ var ( ) func newPolarisRouter() (*polarisRouter, error) { - if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { - return &polarisRouter{ - openRoute: false, - }, nil - } - routerAPI, err := remotingpolaris.GetRouterAPI() if err != nil { return nil, err @@ -69,15 +63,12 @@ func newPolarisRouter() (*polarisRouter, error) { } return &polarisRouter{ - openRoute: true, routerAPI: routerAPI, consumerAPI: consumerAPI, }, nil } type polarisRouter struct { - openRoute bool - routerAPI polaris.RouterAPI consumerAPI polaris.ConsumerAPI @@ -91,13 +82,8 @@ type polarisRouter struct { func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL, invoaction protocol.Invocation) []protocol.Invoker { - if !p.openRoute { - logger.Debug("[Router][Polaris] not open polaris route ability") - return invokers - } - if len(invokers) == 0 { - logger.Warn("[Router][Polaris] invokers from previous router is empty") + logger.Warnf("[tag router] invokers from previous router is empty") return invokers } @@ -294,9 +280,6 @@ func (p *polarisRouter) Priority() int64 { // Notify the router the invoker list func (p *polarisRouter) Notify(invokers []protocol.Invoker) { - if !p.openRoute { - return - } if len(invokers) == 0 { return } diff --git a/filter/polaris/limit/limiter.go b/filter/polaris/limit/limiter.go index 4d68660f6..47d70528d 100644 --- a/filter/polaris/limit/limiter.go +++ b/filter/polaris/limit/limiter.go @@ -18,7 +18,6 @@ package limit import ( - "errors" "fmt" "time" ) @@ -46,11 +45,6 @@ type polarisTpsLimiter struct { } func (pl *polarisTpsLimiter) IsAllowable(url *common.URL, invocation protocol.Invocation) bool { - if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { - logger.Debug("[TpsLimiter][Polaris] not open polaris ratelimit ability") - return true - } - var err error pl.limitAPI, err = remotingpolaris.GetLimiterAPI() diff --git a/go.mod b/go.mod index 7d95c6e50..87354bbea 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 - github.com/hashicorp/vault/sdk v0.6.2 + github.com/hashicorp/vault/sdk v0.6.0 github.com/jinzhu/copier v0.3.5 github.com/knadh/koanf v1.4.4 github.com/magiconair/properties v1.8.7 diff --git a/go.sum b/go.sum index 8f774f97f..c47b8db4d 100644 --- a/go.sum +++ b/go.sum @@ -414,7 +414,7 @@ github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.4.5/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fG
[dubbo-go] branch revert-2171-fix/polaris_governance created (now 17a63f98c)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-2171-fix/polaris_governance in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at 17a63f98c Revert "[ISSUE #2172] Fix/polaris governance (#2171)" This branch includes the following new commits: new 17a63f98c Revert "[ISSUE #2172] Fix/polaris governance (#2171)" The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo-go] 01/01: Revert "[ISSUE #2172] Fix/polaris governance (#2171)"
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch revert-2171-fix/polaris_governance in repository https://gitbox.apache.org/repos/asf/dubbo-go.git commit 17a63f98c9267db5e64302b3bd6ede5e26668224 Author: Xuewei Niu AuthorDate: Wed Feb 1 14:16:21 2023 +0800 Revert "[ISSUE #2172] Fix/polaris governance (#2171)" This reverts commit c1a06982596e2d0c969ff59174e42bfe42430735. --- cluster/router/polaris/router.go| 19 + filter/polaris/limit/limiter.go | 6 -- go.mod | 2 +- go.sum | 8 +++ metadata/service/local/service_proxy.go | 2 -- metadata/service/local_service.go | 7 +- remoting/polaris/builder.go | 38 +++-- 7 files changed, 24 insertions(+), 58 deletions(-) diff --git a/cluster/router/polaris/router.go b/cluster/router/polaris/router.go index d29636dd7..ab71ab3dd 100644 --- a/cluster/router/polaris/router.go +++ b/cluster/router/polaris/router.go @@ -53,12 +53,6 @@ var ( ) func newPolarisRouter() (*polarisRouter, error) { - if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { - return &polarisRouter{ - openRoute: false, - }, nil - } - routerAPI, err := remotingpolaris.GetRouterAPI() if err != nil { return nil, err @@ -69,15 +63,12 @@ func newPolarisRouter() (*polarisRouter, error) { } return &polarisRouter{ - openRoute: true, routerAPI: routerAPI, consumerAPI: consumerAPI, }, nil } type polarisRouter struct { - openRoute bool - routerAPI polaris.RouterAPI consumerAPI polaris.ConsumerAPI @@ -91,13 +82,8 @@ type polarisRouter struct { func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL, invoaction protocol.Invocation) []protocol.Invoker { - if !p.openRoute { - logger.Debug("[Router][Polaris] not open polaris route ability") - return invokers - } - if len(invokers) == 0 { - logger.Warn("[Router][Polaris] invokers from previous router is empty") + logger.Warnf("[tag router] invokers from previous router is empty") return invokers } @@ -294,9 +280,6 @@ func (p *polarisRouter) Priority() int64 { // Notify the router the invoker list func (p *polarisRouter) Notify(invokers []protocol.Invoker) { - if !p.openRoute { - return - } if len(invokers) == 0 { return } diff --git a/filter/polaris/limit/limiter.go b/filter/polaris/limit/limiter.go index 4d68660f6..47d70528d 100644 --- a/filter/polaris/limit/limiter.go +++ b/filter/polaris/limit/limiter.go @@ -18,7 +18,6 @@ package limit import ( - "errors" "fmt" "time" ) @@ -46,11 +45,6 @@ type polarisTpsLimiter struct { } func (pl *polarisTpsLimiter) IsAllowable(url *common.URL, invocation protocol.Invocation) bool { - if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { - logger.Debug("[TpsLimiter][Polaris] not open polaris ratelimit ability") - return true - } - var err error pl.limitAPI, err = remotingpolaris.GetLimiterAPI() diff --git a/go.mod b/go.mod index 7d95c6e50..87354bbea 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 - github.com/hashicorp/vault/sdk v0.6.2 + github.com/hashicorp/vault/sdk v0.6.0 github.com/jinzhu/copier v0.3.5 github.com/knadh/koanf v1.4.4 github.com/magiconair/properties v1.8.7 diff --git a/go.sum b/go.sum index 8f774f97f..c47b8db4d 100644 --- a/go.sum +++ b/go.sum @@ -414,7 +414,7 @@ github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-plugin v1.4.5/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s= +github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zB
[dubbo-go] branch master updated: Revert "Dynamic update config for logger level & metric enable (#2180)" (#2199)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new a645070c6 Revert "Dynamic update config for logger level & metric enable (#2180)" (#2199) a645070c6 is described below commit a645070c6b3a9a29b21a73c1f10cefe20d7ace5f Author: Xuewei Niu AuthorDate: Wed Feb 1 14:16:01 2023 +0800 Revert "Dynamic update config for logger level & metric enable (#2180)" (#2199) This reverts commit 4c6a99bee53e64e6d883673d2f7f463b42b5c42b. --- config/logger_config.go| 8 config/metric_config.go| 13 --- config/root_config.go | 6 --- metrics/prometheus/reporter.go | 88 +- 4 files changed, 26 insertions(+), 89 deletions(-) diff --git a/config/logger_config.go b/config/logger_config.go index 872c444c6..5a499b9cb 100644 --- a/config/logger_config.go +++ b/config/logger_config.go @@ -170,11 +170,3 @@ func (lcb *LoggerConfigBuilder) SetZapConfig(zapConfig ZapConfig) *LoggerConfigB func (lcb *LoggerConfigBuilder) Build() *LoggerConfig { return lcb.loggerConfig } - -// DynamicUpdateProperties dynamically update properties. -func (lc *LoggerConfig) DynamicUpdateProperties(newLoggerConfig *LoggerConfig) { - if newLoggerConfig != nil && lc.ZapConfig.Level != newLoggerConfig.ZapConfig.Level { - lc.ZapConfig.Level = newLoggerConfig.ZapConfig.Level - logger.Infof("LoggerConfig's ZapConfig Level was dynamically updated, new value:%v", lc.ZapConfig.Level) - } -} diff --git a/config/metric_config.go b/config/metric_config.go index 509907007..8b8a04415 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -19,7 +19,6 @@ package config import ( "github.com/creasty/defaults" - "github.com/dubbogo/gost/log/logger" "github.com/pkg/errors" ) @@ -82,15 +81,3 @@ func NewMetricConfigBuilder() *MetricConfigBuilder { func (mcb *MetricConfigBuilder) Build() *MetricConfig { return mcb.metricConfig } - -// DynamicUpdateProperties dynamically update properties. -func (mc *MetricConfig) DynamicUpdateProperties(newMetricConfig *MetricConfig) { - if newMetricConfig != nil { - if newMetricConfig.Enable != mc.Enable { - mc.Enable = newMetricConfig.Enable - logger.Infof("MetricConfig's Enable was dynamically updated, new value:%v", mc.Enable) - - extension.GetMetricReporter("prometheus", mc.ToReporterConfig()) - } - } -} diff --git a/config/root_config.go b/config/root_config.go index ee0387575..88cd00e36 100644 --- a/config/root_config.go +++ b/config/root_config.go @@ -395,10 +395,4 @@ func (rc *RootConfig) Process(event *config_center.ConfigChangeEvent) { } // dynamically update consumer rc.Consumer.DynamicUpdateProperties(updateRootConfig.Consumer) - - // dynamically update logger - rc.Logger.DynamicUpdateProperties(updateRootConfig.Logger) - - // dynamically update metric - rc.Metric.DynamicUpdateProperties(updateRootConfig.Metric) } diff --git a/metrics/prometheus/reporter.go b/metrics/prometheus/reporter.go index 70312..9777c740e 100644 --- a/metrics/prometheus/reporter.go +++ b/metrics/prometheus/reporter.go @@ -78,7 +78,6 @@ func init() { // if you want to use this feature, you need to initialize your prometheus. // https://prometheus.io/docs/guides/go-application/ type PrometheusReporter struct { - reporterServer *http.Server reporterConfig *metrics.ReporterConfig // report the consumer-side's rt gauge data consumerRTSummaryVec *prometheus.SummaryVec @@ -104,10 +103,6 @@ type PrometheusReporter struct { // the role in url must be consumer or provider // or it will be ignored func (reporter *PrometheusReporter) Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) { - if !reporter.reporterConfig.Enable { - return - } - url := invoker.GetURL() var rtVec *prometheus.SummaryVec if isProvider(url) { @@ -225,20 +220,29 @@ func newPrometheusReporter(reporterConfig *metrics.ReporterConfig) metrics.Repor consumerRTSummaryVec: newSummaryVec(consumerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), providerRTSummaryVec: newSummaryVec(providerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), } - pr
[dubbo-go] branch revert-2180-dynamic_update_config created (now b216a4421)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch revert-2180-dynamic_update_config in repository https://gitbox.apache.org/repos/asf/dubbo-go.git at b216a4421 Revert "Dynamic update config for logger level & metric enable (#2180)" This branch includes the following new commits: new b216a4421 Revert "Dynamic update config for logger level & metric enable (#2180)" The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo-go] 01/01: Revert "Dynamic update config for logger level & metric enable (#2180)"
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch revert-2180-dynamic_update_config in repository https://gitbox.apache.org/repos/asf/dubbo-go.git commit b216a44212fafcb8e9e8655cf33031fb80cb7bcd Author: Xuewei Niu AuthorDate: Wed Feb 1 14:15:44 2023 +0800 Revert "Dynamic update config for logger level & metric enable (#2180)" This reverts commit 4c6a99bee53e64e6d883673d2f7f463b42b5c42b. --- config/logger_config.go| 8 config/metric_config.go| 13 --- config/root_config.go | 6 --- metrics/prometheus/reporter.go | 88 +- 4 files changed, 26 insertions(+), 89 deletions(-) diff --git a/config/logger_config.go b/config/logger_config.go index 872c444c6..5a499b9cb 100644 --- a/config/logger_config.go +++ b/config/logger_config.go @@ -170,11 +170,3 @@ func (lcb *LoggerConfigBuilder) SetZapConfig(zapConfig ZapConfig) *LoggerConfigB func (lcb *LoggerConfigBuilder) Build() *LoggerConfig { return lcb.loggerConfig } - -// DynamicUpdateProperties dynamically update properties. -func (lc *LoggerConfig) DynamicUpdateProperties(newLoggerConfig *LoggerConfig) { - if newLoggerConfig != nil && lc.ZapConfig.Level != newLoggerConfig.ZapConfig.Level { - lc.ZapConfig.Level = newLoggerConfig.ZapConfig.Level - logger.Infof("LoggerConfig's ZapConfig Level was dynamically updated, new value:%v", lc.ZapConfig.Level) - } -} diff --git a/config/metric_config.go b/config/metric_config.go index 509907007..8b8a04415 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -19,7 +19,6 @@ package config import ( "github.com/creasty/defaults" - "github.com/dubbogo/gost/log/logger" "github.com/pkg/errors" ) @@ -82,15 +81,3 @@ func NewMetricConfigBuilder() *MetricConfigBuilder { func (mcb *MetricConfigBuilder) Build() *MetricConfig { return mcb.metricConfig } - -// DynamicUpdateProperties dynamically update properties. -func (mc *MetricConfig) DynamicUpdateProperties(newMetricConfig *MetricConfig) { - if newMetricConfig != nil { - if newMetricConfig.Enable != mc.Enable { - mc.Enable = newMetricConfig.Enable - logger.Infof("MetricConfig's Enable was dynamically updated, new value:%v", mc.Enable) - - extension.GetMetricReporter("prometheus", mc.ToReporterConfig()) - } - } -} diff --git a/config/root_config.go b/config/root_config.go index ee0387575..88cd00e36 100644 --- a/config/root_config.go +++ b/config/root_config.go @@ -395,10 +395,4 @@ func (rc *RootConfig) Process(event *config_center.ConfigChangeEvent) { } // dynamically update consumer rc.Consumer.DynamicUpdateProperties(updateRootConfig.Consumer) - - // dynamically update logger - rc.Logger.DynamicUpdateProperties(updateRootConfig.Logger) - - // dynamically update metric - rc.Metric.DynamicUpdateProperties(updateRootConfig.Metric) } diff --git a/metrics/prometheus/reporter.go b/metrics/prometheus/reporter.go index 70312..9777c740e 100644 --- a/metrics/prometheus/reporter.go +++ b/metrics/prometheus/reporter.go @@ -78,7 +78,6 @@ func init() { // if you want to use this feature, you need to initialize your prometheus. // https://prometheus.io/docs/guides/go-application/ type PrometheusReporter struct { - reporterServer *http.Server reporterConfig *metrics.ReporterConfig // report the consumer-side's rt gauge data consumerRTSummaryVec *prometheus.SummaryVec @@ -104,10 +103,6 @@ type PrometheusReporter struct { // the role in url must be consumer or provider // or it will be ignored func (reporter *PrometheusReporter) Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) { - if !reporter.reporterConfig.Enable { - return - } - url := invoker.GetURL() var rtVec *prometheus.SummaryVec if isProvider(url) { @@ -225,20 +220,29 @@ func newPrometheusReporter(reporterConfig *metrics.ReporterConfig) metrics.Repor consumerRTSummaryVec: newSummaryVec(consumerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), providerRTSummaryVec: newSummaryVec(providerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), } - prom.DefaultRegisterer.MustRegister(reporterInstance.consumerRTSummaryVec, reporterInstance.providerRTSummaryVec) - }) - } + metricsExporter, err := ocprom.NewExporter(
[dubbo-go] 02/02: Dynamic update config for logger level & metric enable (#2180)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git commit bd4414762233929144aa3cc5c26615d4455165b6 Author: Wenkang Huang <52915386+huangwenk...@users.noreply.github.com> AuthorDate: Sat Jan 14 12:10:11 2023 +0800 Dynamic update config for logger level & metric enable (#2180) * dynamically update logger level & metric enable * prometheus server start & shutdown * check nil * fix ci Co-authored-by: huangwenkang <642380437@qq> --- config/logger_config.go| 8 config/metric_config.go| 13 +++ config/root_config.go | 6 +++ metrics/prometheus/reporter.go | 88 +- 4 files changed, 89 insertions(+), 26 deletions(-) diff --git a/config/logger_config.go b/config/logger_config.go index 5a499b9cb..872c444c6 100644 --- a/config/logger_config.go +++ b/config/logger_config.go @@ -170,3 +170,11 @@ func (lcb *LoggerConfigBuilder) SetZapConfig(zapConfig ZapConfig) *LoggerConfigB func (lcb *LoggerConfigBuilder) Build() *LoggerConfig { return lcb.loggerConfig } + +// DynamicUpdateProperties dynamically update properties. +func (lc *LoggerConfig) DynamicUpdateProperties(newLoggerConfig *LoggerConfig) { + if newLoggerConfig != nil && lc.ZapConfig.Level != newLoggerConfig.ZapConfig.Level { + lc.ZapConfig.Level = newLoggerConfig.ZapConfig.Level + logger.Infof("LoggerConfig's ZapConfig Level was dynamically updated, new value:%v", lc.ZapConfig.Level) + } +} diff --git a/config/metric_config.go b/config/metric_config.go index 8b8a04415..509907007 100644 --- a/config/metric_config.go +++ b/config/metric_config.go @@ -19,6 +19,7 @@ package config import ( "github.com/creasty/defaults" + "github.com/dubbogo/gost/log/logger" "github.com/pkg/errors" ) @@ -81,3 +82,15 @@ func NewMetricConfigBuilder() *MetricConfigBuilder { func (mcb *MetricConfigBuilder) Build() *MetricConfig { return mcb.metricConfig } + +// DynamicUpdateProperties dynamically update properties. +func (mc *MetricConfig) DynamicUpdateProperties(newMetricConfig *MetricConfig) { + if newMetricConfig != nil { + if newMetricConfig.Enable != mc.Enable { + mc.Enable = newMetricConfig.Enable + logger.Infof("MetricConfig's Enable was dynamically updated, new value:%v", mc.Enable) + + extension.GetMetricReporter("prometheus", mc.ToReporterConfig()) + } + } +} diff --git a/config/root_config.go b/config/root_config.go index 88cd00e36..ee0387575 100644 --- a/config/root_config.go +++ b/config/root_config.go @@ -395,4 +395,10 @@ func (rc *RootConfig) Process(event *config_center.ConfigChangeEvent) { } // dynamically update consumer rc.Consumer.DynamicUpdateProperties(updateRootConfig.Consumer) + + // dynamically update logger + rc.Logger.DynamicUpdateProperties(updateRootConfig.Logger) + + // dynamically update metric + rc.Metric.DynamicUpdateProperties(updateRootConfig.Metric) } diff --git a/metrics/prometheus/reporter.go b/metrics/prometheus/reporter.go index 9777c740e..70312 100644 --- a/metrics/prometheus/reporter.go +++ b/metrics/prometheus/reporter.go @@ -78,6 +78,7 @@ func init() { // if you want to use this feature, you need to initialize your prometheus. // https://prometheus.io/docs/guides/go-application/ type PrometheusReporter struct { + reporterServer *http.Server reporterConfig *metrics.ReporterConfig // report the consumer-side's rt gauge data consumerRTSummaryVec *prometheus.SummaryVec @@ -103,6 +104,10 @@ type PrometheusReporter struct { // the role in url must be consumer or provider // or it will be ignored func (reporter *PrometheusReporter) Report(ctx context.Context, invoker protocol.Invoker, invocation protocol.Invocation, cost time.Duration, res protocol.Result) { + if !reporter.reporterConfig.Enable { + return + } + url := invoker.GetURL() var rtVec *prometheus.SummaryVec if isProvider(url) { @@ -220,29 +225,20 @@ func newPrometheusReporter(reporterConfig *metrics.ReporterConfig) metrics.Repor consumerRTSummaryVec: newSummaryVec(consumerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), providerRTSummaryVec: newSummaryVec(providerPrefix+serviceKey+rtSuffix, reporterConfig.Namespace, labelNames, reporterConfig.SummaryMaxAge), } - prom.DefaultRegisterer.MustRegister(reporterInstance.consumerRTSummaryVec,
[dubbo-go] branch 3.0 updated (fbcc0b394 -> bd4414762)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a change to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git from fbcc0b394 build(deps): bump github.com/RoaringBitmap/roaring from 1.2.2 to 1.2.3 (#2195) new 8279453df [ISSUE #2172] Fix/polaris governance (#2171) new bd4414762 Dynamic update config for logger level & metric enable (#2180) The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: cluster/router/polaris/router.go | 19 - config/logger_config.go | 8 config/metric_config.go | 13 ++ config/root_config.go| 6 +++ filter/polaris/limit/limiter.go | 6 +++ metrics/prometheus/reporter.go | 88 remoting/polaris/builder.go | 38 +++-- 7 files changed, 139 insertions(+), 39 deletions(-)
[dubbo-go] 01/02: [ISSUE #2172] Fix/polaris governance (#2171)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git commit 8279453df4f053bde7b6a5514828e13b3579506e Author: liaochuntao AuthorDate: Sun Jan 1 13:18:08 2023 +0800 [ISSUE #2172] Fix/polaris governance (#2171) * 解决 consumer 不断重连已下线的 provider meta service 问题 (#2166) * registry type support all * fix test * set default to interface * use default protocol registry * fix unit test * use swith to judge * add registry support all test * Resolve registry name conflicts * fix ut err * fix https://github.com/apache/dubbo-go/issues/2159 * del front * del front Co-authored-by: bobtthp Co-authored-by: bob Co-authored-by: bobtthp Co-authored-by: bob * build(deps): bump github.com/hashicorp/vault/sdk from 0.6.0 to 0.6.2 (#2169) Bumps [github.com/hashicorp/vault/sdk](https://github.com/hashicorp/vault) from 0.6.0 to 0.6.2. - [Release notes](https://github.com/hashicorp/vault/releases) - [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/vault/compare/v0.6.0...v0.6.2) --- updated-dependencies: - dependency-name: github.com/hashicorp/vault/sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor:polaris ability open judge * refactor:polaris ability open judge Signed-off-by: dependabot[bot] Co-authored-by: bobtthp Co-authored-by: bobtthp Co-authored-by: bob Co-authored-by: bobtthp Co-authored-by: bob Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- cluster/router/polaris/router.go | 19 ++- filter/polaris/limit/limiter.go | 6 ++ remoting/polaris/builder.go | 38 ++ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/cluster/router/polaris/router.go b/cluster/router/polaris/router.go index ab71ab3dd..d29636dd7 100644 --- a/cluster/router/polaris/router.go +++ b/cluster/router/polaris/router.go @@ -53,6 +53,12 @@ var ( ) func newPolarisRouter() (*polarisRouter, error) { + if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { + return &polarisRouter{ + openRoute: false, + }, nil + } + routerAPI, err := remotingpolaris.GetRouterAPI() if err != nil { return nil, err @@ -63,12 +69,15 @@ func newPolarisRouter() (*polarisRouter, error) { } return &polarisRouter{ + openRoute: true, routerAPI: routerAPI, consumerAPI: consumerAPI, }, nil } type polarisRouter struct { + openRoute bool + routerAPI polaris.RouterAPI consumerAPI polaris.ConsumerAPI @@ -82,8 +91,13 @@ type polarisRouter struct { func (p *polarisRouter) Route(invokers []protocol.Invoker, url *common.URL, invoaction protocol.Invocation) []protocol.Invoker { + if !p.openRoute { + logger.Debug("[Router][Polaris] not open polaris route ability") + return invokers + } + if len(invokers) == 0 { - logger.Warnf("[tag router] invokers from previous router is empty") + logger.Warn("[Router][Polaris] invokers from previous router is empty") return invokers } @@ -280,6 +294,9 @@ func (p *polarisRouter) Priority() int64 { // Notify the router the invoker list func (p *polarisRouter) Notify(invokers []protocol.Invoker) { + if !p.openRoute { + return + } if len(invokers) == 0 { return } diff --git a/filter/polaris/limit/limiter.go b/filter/polaris/limit/limiter.go index 47d70528d..4d68660f6 100644 --- a/filter/polaris/limit/limiter.go +++ b/filter/polaris/limit/limiter.go @@ -18,6 +18,7 @@ package limit import ( + "errors" "fmt" "time" ) @@ -45,6 +46,11 @@ type polarisTpsLimiter struct { } func (pl *polarisTpsLimiter) IsAllowable(url *common.URL, invocation protocol.Invocation) bool { + if err := remotingpolaris.Check(); errors.Is(err, remotingpolaris.ErrorNoOpenPolarisAbility) { + logger.Debug("[TpsLimiter][Polaris] not open polaris ratelimit ability") + return true + } + var err error pl.limitAPI, err = remotingpolaris.Ge
[dubbo-go] branch 3.0-adaptive-stream updated: feat: auto concurrency limiter of adaptive service (#2114)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0-adaptive-stream in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0-adaptive-stream by this push: new d41d88e46 feat: auto concurrency limiter of adaptive service (#2114) d41d88e46 is described below commit d41d88e4664ae07e835072d2dffc16fe8a2ef976 Author: Zhang Yepeng <42159666+cooli...@users.noreply.github.com> AuthorDate: Mon Dec 19 18:50:06 2022 +0800 feat: auto concurrency limiter of adaptive service (#2114) * AutoConcurrencyLimiter with brpc algorithm * go mod * license * fix test timeout * add warn and rename some var * remove unreachable branch --- filter/adaptivesvc/filter.go | 5 +- .../limiter/auto_concurrency_limiter.go| 272 + filter/adaptivesvc/limiter/cpu/cgroup.go | 143 +++ filter/adaptivesvc/limiter/cpu/cgroup_cpu.go | 259 .../limiter/{limiter.go => cpu/stat.go}| 66 +++-- .../limiter/{limiter.go => cpu/stat_test.go} | 36 ++- filter/adaptivesvc/limiter/cpu/utils.go| 137 +++ filter/adaptivesvc/limiter/limiter.go | 1 + filter/adaptivesvc/limiter_mapper.go | 2 + go.mod | 1 + 10 files changed, 880 insertions(+), 42 deletions(-) diff --git a/filter/adaptivesvc/filter.go b/filter/adaptivesvc/filter.go index 11c5015aa..8be46b724 100644 --- a/filter/adaptivesvc/filter.go +++ b/filter/adaptivesvc/filter.go @@ -78,7 +78,7 @@ func (f *adaptiveServiceProviderFilter) Invoke(ctx context.Context, invoker prot // limiter is not found on the mapper, just create // a new limiter if l, err = limiterMapperSingleton.newAndSetMethodLimiter(invoker.GetURL(), - invocation.MethodName(), limiter.HillClimbingLimiter); err != nil { + invocation.MethodName(), limiter.AutoConcurrencyLimiter); err != nil { return &protocol.RPCResult{Err: wrapErrAdaptiveSvcInterrupted(err)} } } else { @@ -144,9 +144,6 @@ func (f *adaptiveServiceProviderFilter) OnResponse(_ context.Context, result pro return &protocol.RPCResult{Err: err} } - // set attachments to inform consumer of provider status - result.AddAttachment(constant.AdaptiveServiceRemainingKey, fmt.Sprintf("%d", l.Remaining())) - result.AddAttachment(constant.AdaptiveServiceInflightKey, fmt.Sprintf("%d", l.Inflight())) logger.Debugf("[adasvc filter] The attachments are set, %s: %d, %s: %d.", constant.AdaptiveServiceRemainingKey, l.Remaining(), constant.AdaptiveServiceInflightKey, l.Inflight()) diff --git a/filter/adaptivesvc/limiter/auto_concurrency_limiter.go b/filter/adaptivesvc/limiter/auto_concurrency_limiter.go new file mode 100644 index 0..bc43ee918 --- /dev/null +++ b/filter/adaptivesvc/limiter/auto_concurrency_limiter.go @@ -0,0 +1,272 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package limiter + +import ( + "math" + "math/rand" + "sync" + "time" +) + +import ( + "github.com/dubbogo/gost/log/logger" + + "go.uber.org/atomic" +) + +import ( + "dubbo.apache.org/dubbo-go/v3/filter/adaptivesvc/limiter/cpu" +) + +var ( + _ Limiter= (*AutoConcurrency)(nil) + _ Updater= (*AutoConcurrencyUpdater)(nil) + cpuLoad *atomic.Uint64 = atomic.NewUint64(0) // range from 0 to 1000 +) + +// These parameters may need to be different between services +const ( + MaxExploreRatio= 0.3 + MinExploreRatio= 0.06 + SampleWindowSizeMs = 1000 + MinSampleCount = 40 + MaxSampleCount = 500 +
[dubbo-go] branch 3.0 updated: support load subscribe instance (#2139)
This is an automated email from the ASF dual-hosted git repository. justxuewei pushed a commit to branch 3.0 in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/3.0 by this push: new 18995c798 support load subscribe instance (#2139) 18995c798 is described below commit 18995c7983a15ed03f7ae3a72ea8d239845c29c4 Author: binbin.zhang AuthorDate: Thu Dec 15 09:13:36 2022 +0800 support load subscribe instance (#2139) --- registry/base_registry.go | 5 + registry/directory/directory.go| 8 ++-- registry/etcdv3/registry.go| 5 + registry/mock_registry.go | 5 + registry/nacos/registry.go | 23 ++ registry/polaris/registry.go | 23 ++ registry/registry.go | 6 ++ .../servicediscovery/service_discovery_registry.go | 5 + registry/xds/registry.go | 5 + registry/zookeeper/registry.go | 5 + registry/zookeeper/service_discovery.go| 4 ++-- 11 files changed, 90 insertions(+), 4 deletions(-) diff --git a/registry/base_registry.go b/registry/base_registry.go index 7fb38e4a9..0fa643c21 100644 --- a/registry/base_registry.go +++ b/registry/base_registry.go @@ -407,6 +407,11 @@ func (r *BaseRegistry) UnSubscribe(url *common.URL, notifyListener NotifyListene return nil } +// LoadSubscribeInstances load subscribe instance +func (r *BaseRegistry) LoadSubscribeInstances(url *common.URL, notify NotifyListener) error { + return r.facadeBasedRegistry.LoadSubscribeInstances(url, notify) +} + // closeRegisters close and remove registry client and reset services map func (r *BaseRegistry) closeRegisters() { logger.Infof("begin to close provider client") diff --git a/registry/directory/directory.go b/registry/directory/directory.go index 5f1f12dd2..b975462c0 100644 --- a/registry/directory/directory.go +++ b/registry/directory/directory.go @@ -91,6 +91,12 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (director } dir.consumerConfigurationListener = newConsumerConfigurationListener(dir) + dir.consumerConfigurationListener.addNotifyListener(dir) + dir.referenceConfigurationListener = newReferenceConfigurationListener(dir, url) + + if err := dir.registry.LoadSubscribeInstances(url.SubURL, dir); err != nil { + return nil, err + } go dir.subscribe(url.SubURL) return dir, nil @@ -99,8 +105,6 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (director // subscribe from registry func (dir *RegistryDirectory) subscribe(url *common.URL) { logger.Debugf("subscribe service :%s for RegistryDirectory.", url.Key()) - dir.consumerConfigurationListener.addNotifyListener(dir) - dir.referenceConfigurationListener = newReferenceConfigurationListener(dir, url) if err := dir.registry.Subscribe(url, dir); err != nil { logger.Error("registry.Subscribe(url:%v, dir:%v) = error:%v", url, dir, err) } diff --git a/registry/etcdv3/registry.go b/registry/etcdv3/registry.go index 9a86bef0b..42f7e4bf5 100644 --- a/registry/etcdv3/registry.go +++ b/registry/etcdv3/registry.go @@ -168,6 +168,11 @@ func (r *etcdV3Registry) DoUnsubscribe(conf *common.URL) (registry.Listener, err return nil, perrors.New("DoUnsubscribe is not support in etcdV3Registry") } +// LoadSubscribeInstances load subscribe instance +func (r *etcdV3Registry) LoadSubscribeInstances(_ *common.URL, _ registry.NotifyListener) error { + return nil +} + func (r *etcdV3Registry) handleClientRestart() { r.WaitGroup().Add(1) go etcdv3.HandleClientRestart(r) diff --git a/registry/mock_registry.go b/registry/mock_registry.go index 8f4505c75..5407dc681 100644 --- a/registry/mock_registry.go +++ b/registry/mock_registry.go @@ -131,6 +131,11 @@ func (r *MockRegistry) UnSubscribe(url *common.URL, notifyListener NotifyListene return nil } +// LoadSubscribeInstances load subscribe instance +func (r *MockRegistry) LoadSubscribeInstances(_ *common.URL, _ NotifyListener) error { + return nil +} + type listener struct { count int64 registry *MockRegistry diff --git a/registry/nacos/registry.go b/registry/nacos/registry.go index 46da4bc66..edf44c18d 100644 --- a/registry/nacos/registry.go +++ b/registry/nacos/registry.go @@ -19,6 +19,7 @@ package nacos import ( "bytes" + "fmt" "strconv" "strings" "time" @@ -38,6 +39,7 @@ import ( "dubbo.apache.org/dubbo-go/v3/common/constant" "dubbo.apache.or
svn commit: r58450 [2/3] - in /dev/dubbo: KEYS dubbo-go/v3.0.4-rc1/ dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz.asc dubbo-go/v3.0.4-rc1/dubbo-
Modified: dev/dubbo/KEYS == --- dev/dubbo/KEYS (original) +++ dev/dubbo/KEYS Sun Dec 4 03:52:40 2022 @@ -1,17163 +1,48 @@ -This file contains the PGP keys of various developers. - -Users: pgp < KEYS -or - gpg --import KEYS - - -Developers: -pgp -kxa and append it to this file. -or -(pgpk -ll && pgpk -xa ) >> this file. -or -(gpg --list-sigs -&& gpg --armor --export ) >> this file. - -pub rsa4096/28681CB1 2018-04-26 - Key fingerprint = 8132 F9B7 4796 E1DF C15D 6D99 52E6 1033 2868 1CB1 -uid [ultimate] liujun (apache-dubbo) -sub rsa4096/D3D6984B 2018-04-26 - --BEGIN PGP PUBLIC KEY BLOCK- -Version: SKS 1.1.6 -Comment: Hostname: pgp.mit.edu - -mQINBFrhoE4BEACnmRA5LiwTLsBAOBvfWxR5KD3+YxaQdgibqwfCTTTzLk2rJ8dzHwp7J2c9 -fsSqUyQoZaWfhDKbEpVVrs69jiZ/z5s2kuBTc/noSSkNH/AGebUfbviNdX9vph9w6ur/Xfff -dKHDFgIYlyDHZBmPcT0gqDWifHn0nfOcrm5brGJwsVVZDqnUkcEELWF9oxLus2qOYB/cnif1 -7ljcvn/EXoiSsnh5/sZHBJ2HujEhFh1NJlnov3MSN3y+5nP0yyvtdoCv4CaPan3Ct2o4pBwQ -V6GuY4f82VhBJZXHbMNeH8IwHkLL1MlM2ZEWw1FxTBYOfb+JAvraRIw0Cz6TH5WyypWSlGVn -6sbobVWLkP4/TBkOKM/YVDmCCz6gCZaEd06S+y+35cqKRdrfFoqwEMzp6VB0QoUsuX3k+JG1 -4eIS+RF5kWsMq7hp4xdBL9gXo39ZpYFIj7Z65Re2l5WAAxOwlaEfOCTOpuM+RiarGgjQrIeJ -rYB8XXGIFYDmva+HAuAynkrltd71rF1LpkCQpTsuXjrFib2xu/Uw+MmQqqm11wCCn7jSE1XY -YUvpexcNMsQ6y5jxbOxvO0Pt8090giKDUQpVBvvSFcNdn7YxTkrWc3VfvdMLEyhCTXOIufOC -hmMikDhwb4RWkJMBcXht16fmxnkrCaP4PxOjLu2BUr08F8c9RwARAQABtClsaXVqdW4gKGFw -YWNoZS1kdWJibykgPGxpdWp1bkBhcGFjaGUub3JnPokCTgQTAQgAOBYhBIEy+bdHluHfwV1t -mVLmEDMoaByxBQJa4aBOAhsDBQsJCAcCBhUICQoLAgQWAgMBAh4BAheAAAoJEFLmEDMoaByx -YiAQAJiP2WoaRzS4KoW4z4ye+tIcOkjb8Cltnwfza8ceqccNHwwGlDvL3+0x1ttf5ob2ho5e -NuvGVk8GZCbuUKajIWTtKz4LNRd6Q1GcHGxj4r6QN6wD5GfQH6WNEmliB7m1NMuFs+U87+Jr -rnMsmom5FkDtBWYcLVwMVN2kWgfY4TvraFb+R4l9iJuLZKxfXfvDg/heem5j+64xd/4bETNd -GPEpRWBMQkZ//pp1ivvBQS0L+UVUI4XIb3MRXRwCO2rg5guNmD+KD5iBOirdx/cHikLzEZwu -6/76paTr1hw17q+mkFU/ZDY7yOyrI9V7yX1kTKbHBswh+9heBJ10XkMDlD901E56E69tB5lV -eKAPiugve1xpdK+gBe6BXuWGe8fCuPeSi4XGJS/NvGF4SMPrTQsFaLsYX8TaPOEN9F9nzFp5 -gAi8fFQ2BAKyVUJqZaAdKCogLutjKKsBUMAJSlJlAXaE02LBoGulD9WiZnM3vpfaPSHOkRSm -K2LAtoYHwUDMKg0hzJ9kjqAC72vpriBkciyEy8oDb/PtQh/45dRWYkPcTnUo0Yk7ZqO2YEte -g2qXyBelwyeMTktoF2OIiGZKQsrP0J9yPOM7j/+Gj/EJEl5+mPuW627HBd5Ub3dzbM+imk35 -Z6jqYvRvg829es78uJtQDblB8Lb8SAMVDI4L6fEXuQINBFrhoE4BEACz+/25gRRAaB7V+FO0 -/Bjx9Du56iQhQTEcUXG3zvTErorKDEc7W0A+sPNSem3K4Hew6KqS0jinIPBAtFr/z4sF72bV -gZsvCm1gjvheJgV9T2eAx/5in0G4ABoVxoWCFpKzKlg5Hb9FxNb25CVjJ0wiqgqHRnUhNrTN -GcPJVCQ4YOFLm4ahiQ7tD+d2ABeUbEtdRd5iPSLDo/ZJy8ib3WzyDbH3RIGJE3QzpMj+nJRv -mce+qKq5aMtK5bwnI2tBd/hnCUq2n7kK5IrKlXoVYDy2mHVlaINzQgfa+HUl9DaAMH3D9JLR -94jE8qQ8JtgH/UjelxpKSwXCTC/2EgU2jC8ZlbK7eGBh0gKWooBHIwH2E7QaQb0BZJCcP0R6 -gQo2se2R0CeRLUF8Momz3iSqniPixUk2Iz/Bprp2ksU+mk4EzeXlW+UknVrZildErqeH7u8y -RO/lhTM5QVZTy98OkSuJJVkC/qGHr1S1atdWMxh8NULI2qA/iFG6TxA11dcRszQMOVFJKZnu -a9ja2FUlsomlfrwd+t8TsjvsxUZHH19iwbdt0VS0kOqk4BemIGBiW6vfL2z22Psl1yt+m6Vp -dc4g+n4i4KPJqzqPs3xRkFMgh1vihfoJ/3cu2W1iVFpK+5UeubCjnrkbPF89LQ1Lr8SrYmn0 -Ja5S+xLoc6/caNyYzwARAQABiQI2BBgBCAAgFiEEgTL5t0eW4d/BXW2ZUuYQMyhoHLEFAlrh -oE4CGwwACgkQUuYQMyhoHLEhBA/9GovckuEc4XFrYJdFBv+w0Y66LCvb51kQWr44hoLPXBhQ -gduxDN15ZrxCo4QcZSRNEte3O5UXz9bEeBPhf2oDA226zwgVYEX4aNizPcnaI30mLUkACnsG -n5Rps1Cshsuw/XyBkYLOERbBMLp2G+iMmKzDzaw0bmV6FOB885dtSD6Y+n0oHVmJKxXFljMB -T24+46aHUSleK9siSgqA++T7JIGVaKGaQWJ8p6Lzc43a/8/TD8squifcGrqd4aOHL06Jcm6E -nMKn6HRorIgH9qNs/cQqaKJrLjE9kHQf1B9pu+MdYizUPrDWBX9twQkEBIR2F7ZPRZaRBdkb -k5fsmi5UhfCgwkqW3+bS4tMqryFkQsNlOShFrDLwRVzD2133yTMpSBAFeOPuKxZ1TehQuFir -vcISEbV0ph8CbHVhRxkkOdIuRz1bW6kHgAyuWhEgdbRDYV2lhFzKy4JJGjJ/UU/9LjDP0qlt -yqqO3+xqS5kYRTcqsrNxFZvwodSaxBuT5Ab2DMqqPMo+nCZt0kAPdJI4HHQ+MhM21SaotGAi -4OkDjNcu+yzG4b3QchABQyIVXMPoyXtURd5LWv62d4ZkPNwc8vhQPOEkK+5UwBSGDtWwlrii -cilA/EthmgnB5gV1vAQgpx5vNpCQuKpdMlLsrk7EV1ysNubPUoo7cEeSyZzcPKA= -=azvM --END PGP PUBLIC KEY BLOCK-pub rsa4096 2018-09-13 [SC] - 47B6D4B2F31AF7EC6AA8D14E7955FB6D1DD21CF7 -uid [ ç»å¯¹ ] jerrick (CODE SIGNING KEY) -sig 37955FB6D1DD21CF7 2018-09-13 jerrick (CODE SIGNING KEY) -sub rsa4096 2018-09-13 [E] -sig 7955FB6D1DD21CF7 2018-09-13 jerrick (CODE SIGNING KEY) - --BEGIN PGP PUBLIC KEY BLOCK- - -mQINBFuaBxsBEADDbjm/queXcN5mkFgJdye2zA4H8tM8GXSiEHgY1c+ldOauUIeO -uLTBa0P9eX6j6Hp6EoAZxIHQ1pZJqc3C53+yD8v55q1gkDhs9gUAVXez4ZokxNo0 -ryfLeC2hUvypvP8As5jgPWWoX+NCoQSAz3OkQSIlYHyrtZw9+8t7jcndCTIXx9yy -riOz8NJ1220nw+oBC7UBqhtFEGPquJvrDz6tI88yFMRoQSZaA7KbNlhuTc6SDFeI -AR6MNRaQFgMz5m2RTIdU9ts5wdfcTa1ur6VtD9ww4BEqhUjtJESaKDXq915UR0nn -gE8TSJqiCezCvqqqAi+6YmrnfyTI7ZKLjw5Mefi8IEMuilbd+mRlKT1Nzt9PiOM3 -d1igb4xsD3U4iPKH25i2Jk4ssKxoIFdqcotkGUI+DhIqpN+CtArDZ19oIuyXev1U -mGsle0aU/PIbCYI6J73PJLFz8oEhqHTsczeOMznagLjLjcNHiCF+3zRzG2fA6/tA -let/WRGfWW9GWmgac7YC9BAJRJ9RUA4taYP03irqDAYsLgAiGYLKUabENmVxNBL3 -ncauY/AMkBt28p2oUID8enCiP+uf/aEOoiWpmi9tu2c9A31e0pO/tb00h5h3Djvw -kLh1JbfDCVZ/V4R274fuvtecSe5b3S7wgx4UKDSIXRptdbdqYhFN7ruU9QARAQAB -tC9qZXJ
svn commit: r58450 [1/3] - in /dev/dubbo: KEYS dubbo-go/v3.0.4-rc1/ dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz.asc dubbo-go/v3.0.4-rc1/dubbo-
Author: justxuewei Date: Sun Dec 4 03:52:40 2022 New Revision: 58450 Log: Release dubbo-go v3.0.4-rc1 Added: dev/dubbo/dubbo-go/v3.0.4-rc1/ dev/dubbo/dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz (with props) dev/dubbo/dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz.asc dev/dubbo/dubbo-go/v3.0.4-rc1/dubbo-go-v3.0.4-rc1-src.tar.gz.sha512 Modified: dev/dubbo/KEYS