Skip to content
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

Domain name resolution failed causes core dumped #131

Open
spaceack opened this issue Jan 11, 2023 · 1 comment
Open

Domain name resolution failed causes core dumped #131

spaceack opened this issue Jan 11, 2023 · 1 comment

Comments

@spaceack
Copy link

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

[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 <module>
    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 </root/rocketmq-client-cpp-2.1.0/src/transport/TcpTransport.cpp> 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 </root/rocketmq-client-cpp-2.1.0/src/transport/TcpTransport.cpp> line:103
Aborted (core dumped)

code

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) 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=<optimized out>)
    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 <typeinfo for rocketmq::MQClientException>, 
    dest=0x7f45a696e1f0 <rocketmq::MQClientException::~MQClientException()>)
    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<char, std::char_traits<char>, std::allocator<char> >&) () from /opt/env/miniconda3/lib/librocketmq.so
#7  0x00007f45a6a3f4c3 in rocketmq::TcpTransport::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) () from /opt/env/miniconda3/lib/librocketmq.so
#8  0x00007f45a6a38f5d in rocketmq::TcpRemotingClient::CreateTransport(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > 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<char, std::char_traits<char>, std::allocator<char> > const&, bool) ()
   from /opt/env/miniconda3/lib/librocketmq.so
#11 0x00007f45a6a3b764 in rocketmq::TcpRemotingClient::invokeSync(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocketmq::RemotingCommand&, int) ()
   from /opt/env/miniconda3/lib/librocketmq.so
#12 0x00007f45a696cf8b in rocketmq::MQClientAPIImpl::getTopicRouteInfoFromNameServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, rocketmq::SessionCredentials const&) () from /opt/env/miniconda3/lib/librocketmq.so
#13 0x00007f45a697bcb5 in rocketmq::MQClientFactory::updateTopicRouteInfoFromNameServer(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > 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::basic_deadline_timer<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime>, boost::asio::deadline_timer_service<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime> > > >) () from /opt/env/miniconda3/lib/librocketmq.so
#15 0x00007f45a6980ba9 in boost::asio::detail::wait_handler<boost::_bi::bind_t<void, boost::_mfi::mf2<void, rocketmq::MQClientFactory, boost::system::error_code&, boost::shared_ptr<boost::asio::basic_deadline_timer<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime>, boost::asio::deadline_timer_service<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime> > > > >, boost::_bi::list3<boost::_bi::value<rocketmq::MQClientFactory*>, boost::_bi::value<boost::system::error_code>, boost::_bi::value<boost::shared_ptr<boost::asio::basic_deadline_timer<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime>, boost::asio::deadline_timer_service<boost::posix_time::ptime, boost::asio::time_traits<boost::posix_time::ptime> > > > > > > >::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

@messense
Copy link
Member

Sorry, it's unlikely there will be updates since rocketmq clients development has moved to https://github.com/apache/rocketmq-clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants