diff --git a/config/support/service_config.go b/config/support/service_config.go index 56b7b6d83fcc220ff9da307d9667321b177583d7..66c55470ccc3631a4a972cb3971dc99faf5b02ea 100644 --- a/config/support/service_config.go +++ b/config/support/service_config.go @@ -99,6 +99,9 @@ func (srvconfig *ServiceConfig) Export() error { } srvconfig.cacheMutex.Unlock() exporter := srvconfig.cacheProtocol.Export(invoker) + if exporter == nil{ + panic(jerrors.New("New exporter error")) + } srvconfig.exporters = append(srvconfig.exporters, exporter) } } diff --git a/examples/jsonrpc/go-client/app/client.go b/examples/jsonrpc/go-client/app/client.go index e559c3640aac93dc24338740b506f339a47583b6..1e52654df296ab8ce329076e1023eb6650dc076f 100644 --- a/examples/jsonrpc/go-client/app/client.go +++ b/examples/jsonrpc/go-client/app/client.go @@ -47,7 +47,7 @@ func main() { initProfiling() - time.Sleep(5e9) + time.Sleep(10e9) gxlog.CInfo("\n\n\nstart to test jsonrpc") user := &JsonRPCUser{} diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go index 9e35dd243985513f86b29f397dafd4fd9082d8e2..93104e443c5feec5909a84b313e353e50db78236 100644 --- a/registry/protocol/protocol.go +++ b/registry/protocol/protocol.go @@ -96,7 +96,8 @@ func (proto *RegistryProtocol) Export(invoker protocol.Invoker) protocol.Exporte err := reg.Register(providerUrl) if err != nil { - log.Error("provider service %v register registry %v error, error message is %s", providerUrl.String(), registryUrl.String(), err.Error()) + log.Error("provider service %v register registry %v error, error message is %s", providerUrl.Key(), registryUrl.Key(), err.Error()) + return nil } key := providerUrl.Key() diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index 9cfa92e54b5e21b2f28dba85fa328474dae5c34e..6bf44c4899fb2f4dabdd9062660ece3e8c198c2a 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -3,7 +3,6 @@ package zookeeper import ( "context" "fmt" - "github.com/dubbo/dubbo-go/common/constant" "net/url" "os" "strconv" @@ -20,6 +19,7 @@ import ( ) import ( + "github.com/dubbo/dubbo-go/common/constant" "github.com/dubbo/dubbo-go/common/extension" "github.com/dubbo/dubbo-go/config" "github.com/dubbo/dubbo-go/registry" @@ -89,7 +89,7 @@ func NewZkRegistry(url *config.URL) (registry.Registry, error) { err = r.validateZookeeperClient() if err != nil { - return nil, jerrors.Trace(err) + return nil, err } r.wg.Add(1) @@ -185,6 +185,7 @@ LOOP: if err == nil { // copy r.services r.cltLock.Lock() + services = []config.URL{} for _, confIf = range r.services { services = append(services, confIf) } @@ -291,7 +292,9 @@ func (r *ZkRegistry) register(c config.URL) error { return jerrors.Trace(err) } params = url.Values{} - params = c.Params + for k, v := range c.Params { + params[k] = v + } params.Add("pid", processID) params.Add("ip", localIP)