-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
配置中心,增加add_config_watcher python3.10 监听报TypeError: cannot pickle '_thread.RLock' object 有大佬解决么 #124
Comments
Confirmed. 3.9.12也遇到同样的报错了。
注册服务、获取配置、发送心跳都正常 |
问题定位到了,就是Python版本不支持,换成Python3.7.3的虚拟环境,不再报这个错误。 |
更多测试: |
你应该也是用的也是非Windows系统吧?这个问题是由几个不可序列化的对象导致的。
等我弄清楚了就写一个PR |
在非windows环境改用mp库中的RLock,同时将不需要序列话的process_mgr和callback_tread_pool标记为transient FIX TO ISSUE nacos-group#124
mac 上的。 不过我看,nacos 2.1.2 的open api 没有监听的内容了,是不是新的版本,不需要监听了? |
看官方文档的意思是,这个方法在1.X中存在,由于2.X兼容1.X所以还存在。 我用的nacos2.2.0 BETA. 仍然有这个方法,实现我方法我也写在PR#125里了。 至于是否在未来的版本考虑放弃兼容1.X,彻底移出这个方法不得而知。 |
…t_list_naming_instance_online需要配合本地服务(实际已经成功) FIX TO ISSUE nacos-group#124 Info to nacos-group#125
Traceback (most recent call last):
File "/Users/oker/Documents/PyProject/ui-autotest-cases/libs/x_nacos.py", line 80, in
client.add_config_watcher(AB_TEST_CITY_VERSION_CONFIG, NACOS_CONFIG_GROUP, utest_cb) # 这个必须放在main里面完成
File "/Users/oker/Documents/PyProject/ui-autotest-cases/venv/lib/python3.10/site-packages/nacos/commons.py", line 10, in synced_func
return func(*args, **kws)
File "/Users/oker/Documents/PyProject/ui-autotest-cases/venv/lib/python3.10/site-packages/nacos/client.py", line 520, in add_config_watcher
self.add_config_watchers(data_id, group, [cb], content)
File "/Users/oker/Documents/PyProject/ui-autotest-cases/venv/lib/python3.10/site-packages/nacos/commons.py", line 10, in synced_func
return func(*args, **kws)
File "/Users/oker/Documents/PyProject/ui-autotest-cases/venv/lib/python3.10/site-packages/nacos/client.py", line 566, in add_config_watchers
puller.start()
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/context.py", line 288, in _Popen
return Popen(process_obj)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle '_thread.RLock' object
The text was updated successfully, but these errors were encountered: