apache / dubbo-python2

Python Dubbo Client
Apache License 2.0
60 stars 18 forks source link

fix: ZkRegister object has no attribute 'hosts' #10

Closed wuwen5 closed 2 months ago

wuwen5 commented 3 years ago
File "/Library/Python/2.7/site-packages/dubbo/client.py", line 157, in __resubscribe
    for interface in self.hosts.keys():
AttributeError: 'ZkRegister' object has no attribute 'hosts'
biyuhao commented 3 years ago

Thanks for the pr. Would you please provide the steps to reproduce this issue?

wuwen5 commented 3 years ago

just a normal call

from dubbo.client import DubboClient, ZkRegister

zk = ZkRegister('172.19.97.81:2181')

dubbo_cli = DubboClient('com.x.x.service.XProvider', zk_register=zk, version="2.0")

response = dubbo_cli.call('methodA', '13800138000')
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Library/Python/2.7/site-packages/dubbo/client.py", line 157, in __resubscribe
    for interface in self.hosts.keys():
AttributeError: 'ZkRegister' object has no attribute 'hosts'