apache / apache/rocketmq-client-python

Domain name resolution failed causes core dumped

Đang mở
#131 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
305
Fork
98
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Description
When there are unresolvable domain names, there will be occasional core dumped.
## env
rocketmq-4.9.2
rocketmq-client-python-1.2.0
rocketmq-client-cpp-2.1.0

## error info
```bash
[root@localhost tmp]# /opt/env/miniconda3/bin/python3 test_mq.py
start consume message
Traceback (most recent call last):
File "test_mq.py", line 20, in
start_consume_message()
File "test_mq.py", line 13, in start_consume_message
consumer.start()
File "/opt/env/miniconda3/lib/python3.7/site-packages/rocketmq/client.py", line 370, in start
ffi_check(dll.StartPushConsumer(self._handle))
File "/opt/env/miniconda3/lib/python3.7/site-packages/rocketmq/exceptions.py", line 44, in ffi_check
raise exc_cls(msg)
rocketmq.exceptions.PushConsumerStartFailed: Failed to resolve host name(testmq1.mq): nodename nor servname provided, or not known,error:-1,in file line:103
terminate called after throwing an instance of 'rocketmq::MQClientException'
what(): msg: Failed to resolve host name(testmq1.mq): nodename nor servname provided, or not known,error:-1,in file line:103
Aborted (core dumped)
```
## code
```python
from rocketmq.client import PushConsumer, ConsumeStatus
import time

def callback(msg):
print(msg.id, msg.body, msg.get_property('property'))
return ConsumeStatus.CONSUME_SUCCESS

def start_consume_message():
consumer = PushConsumer('consumer_group')
consumer.set_name_server_address('testmq1.mq:9876')
consumer.subscribe('TopicTest', callback)
print ('start consume message')
consumer.start()

while True:
time.sleep(3600)

if __name__ == '__main__':
start_consume_message()
```

## gdb info
```gdb
(gdb) bt
#0 0x00007f45b42086eb in raise () from /lib64/libc.so.6
#1 0x00007f45b4209a11 in abort () from /lib64/libc.so.6
#2 0x00007f45a676e84a in __gnu_cxx::__verbose_terminate_handler ()
at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libstdc++-v3/libsupc++/vterminate.cc:95
#3 0x00007f45a676cf47 in __cxxabiv1::__terminate (handler=)
at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4 0x00007f45a676cf7d in std::terminate () at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5 0x00007f45a676d15a in __cxxabiv1::__cxa_throw (obj=0x7f457c0044a0, tinfo=0x7f45a6b6fdd8 ,
dest=0x7f45a696e1f0 )
at /home/nwani/m3/conda-bld/compilers_linux-64_1560109574129/work/.build/x86_64-conda_cos6-linux-gnu/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
#6 0x00007f45a6a3e817 in rocketmq::TcpTransport::getInetAddr(std::__cxx11::basic_string, std::allocator >&) () from /opt/env/miniconda3/lib/librocketmq.so
#7 0x00007f45a6a3f4c3 in rocketmq::TcpTransport::connect(std::__cxx11::basic_string, std::allocator > const&, int) () from /opt/env/miniconda3/lib/librocketmq.so
#8 0x00007f45a6a38f5d in rocketmq::TcpRemotingClient::CreateTransport(std::__cxx11::basic_string, std::allocator > const&, bool) ()
from /opt/env/miniconda3/lib/librocketmq.so
#9 0x00007f45a6a39399 in rocketmq::TcpRemotingClient::CreateNameServerTransport(bool) () from /opt/env/miniconda3/lib/librocketmq.so
#10 0x00007f45a6a3959b in rocketmq::TcpRemotingClient::GetTransport(std::__cxx11::basic_string, std::allocator > const&, bool) ()
from /opt/env/miniconda3/lib/librocketmq.so
#11 0x00007f45a6a3b764 in rocketmq::TcpRemotingClient::invokeSync(std::__cxx11::basic_string, std::allocator > const&, rocketmq::RemotingCommand&, int) ()
from /opt/env/miniconda3/lib/librocketmq.so
#12 0x00007f45a696cf8b in rocketmq::MQClientAPIImpl::getTopicRouteInfoFromNameServer(std::__cxx11::basic_string, std::allocator > const&, int, rocketmq::SessionCredentials const&) () from /opt/env/miniconda3/lib/librocketmq.so
#13 0x00007f45a697bcb5 in rocketmq::MQClientFactory::updateTopicRouteInfoFromNameServer(std::__cxx11::basic_string, std::allocator > const&, rocketmq::SessionCredentials const&, bool) () from /opt/env/miniconda3/lib/librocketmq.so
#14 0x00007f45a697f3f9 in rocketmq::MQClientFactory::updateTopicRouteInfo(boost::system::error_code&, boost::shared_ptr, boost::asio::deadline_timer_service > > >) () from /opt/env/miniconda3/lib/librocketmq.so
#15 0x00007f45a6980ba9 in boost::asio::detail::wait_handler, boost::asio::deadline_timer_service > > > >, boost::_bi::list3, boost::_bi::value, boost::_bi::value, boost::asio::deadline_timer_service > > > > > > >::do_complete(boost::asio::detail::task_io_service*, boost::asio::detail::task_io_service_operation*, boost::system::error_code const&, unsigned long) () from /opt/env/miniconda3/lib/librocketmq.so
#16 0x00007f45a6985b5a in boost::asio::detail::task_io_service::run(boost::system::error_code&) () from /opt/env/miniconda3/lib/librocketmq.so
#17 0x00007f45a697eccc in rocketmq::MQClientFactory::startScheduledTask(bool) () from /opt/env/miniconda3/lib/librocketmq.so
#18 0x00007f45a6a84f5e in thread_proxy () from /opt/env/miniconda3/lib/librocketmq.so
#19 0x00007f45b4398fed in ?? () from /lib64/libpthread.so.0
#20 0x00007f45b42cc18f in clone () from /lib64/libc.so.6
```
How to avoid this core dumped?

Hope this can be fixed, thank you very much!

@messense @ifplusor

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.