-
Notifications
You must be signed in to change notification settings - Fork 52
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
多线程崩溃问题,使用多个端口多个线程,模拟多节点部署服务注册和心跳发送 #130
Comments
每个线程设一个不同的nacos::PropertyKeyConst::UDP_RECEIVER_PORT试试呢,我这里能work |
碰到相同的问题,也是第二个线程跑到 NamingService *namingSvc = factory->CreateNamingService(); 的时候 就崩溃了; 请问楼主解决了吗? |
问题描述:
想使用多个线程多个端口模拟多节点部署注册服务和心跳发送。
使用临时实例并且保持 NamingService *namingSvc实例对象不被析构(使用while(true)),从而实现自动发送心跳。
第一个线程能够正常启动并注册服务,但是第二个线程跑到NamingService *namingSvc = factory->CreateNamingService();处就会崩溃。
报错信息:
信号: SIGABRT (Aborted)
Nacos SDK异常: Login failed after all servers are tried
请大佬们帮忙看一下:
1 .具体是什么原因导致资源竞争的出现。
2. 是否还有其他方案实现多节点部署注册服务和心跳发送。
代码主要部分:
调试报错显示:
信号: SIGABRT (Aborted)
Nacos SDK异常: Login failed after all servers are tried
The text was updated successfully, but these errors were encountered: