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

random "Failed to resolve address Exception" after several successful resolutions #133

Closed
abhiguru opened this issue Dec 8, 2016 · 4 comments

Comments

@abhiguru
Copy link

abhiguru commented Dec 8, 2016

Getting this error at random times, First attempt it resolves the ip address and the second time same address it throws an exception this exception is after at least 100+ such successful resolutions of the same domain (The original domain has been changed below...)

Would appreciate any pointers on what might be causing this

Url is r6---sn-ci5gup-cagl.xyzvideo.com:443
I1208 08:31:48.732450 24185 main.cpp:1987] Trying to connect to 182.79.238.145:443
SSL Inited
Url is r6---sn-ci5gup-cagl.xyzvideo.com:443
E1208 08:31:48.743717 24185 EventBase.cpp:82] runInEventBaseThread() function threw a St12system_error exception: Failed to resolve address for "r6---sn-ci5gup-cagl.xyzvideo.com": Name or service not known (error=-2): Unknown error -2

Thread 2 "CPUThreadPool0" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffec07e700 (LWP 24185)]
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
58 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1 0x00007ffff59533ea in __GI_abort () at abort.c:89
#2 0x00007ffff79fbc15 in folly::EventBase::FunctionRunner::messageAvailable(folly::Function<void ()>&&) (msg=<unknown type in /usr/local/lib/libfolly.so.57, CU 0x80dc49, DIE 0x83a080>,
this=0x7fffe4002300) at io/async/EventBase.cpp:84
#3 folly::NotificationQueue<folly::Function<void ()> >::Consumer::consumeMessages(bool, unsigned long*) (this=0x7fffe4002300, isDrain=, numConsumed=)
at ./../folly/io/async/NotificationQueue.h:727
#4 0x00007ffff3feaa0c in event_base_loop () from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#5 0x00007ffff79f4bd0 in folly::EventBase::loopBody (this=this@entry=0x7fffec07d540, flags=flags@entry=0) at io/async/EventBase.cpp:324
#6 0x00007ffff79f5607 in folly::EventBase::loop (this=this@entry=0x7fffec07d540) at io/async/EventBase.cpp:262
#7 0x00007ffff79f68b6 in folly::EventBase::loopForever (this=0x7fffec07d540) at io/async/EventBase.cpp:453
#8 0x000055555570b1a2 in VideoProcessor::initSegmentListener() ()
#9 0x000055555570aecd in VideoProcessor::VideoProcessor(folly::EventBase*, folly::ProducerConsumerQueue<std::vector<vcu::HLSSegment, std::allocatorvcu::HLSSegment > >, folly::basic_fbstring<char, std::char_traits, std::allocator, folly::fbstring_core >) ()
#10 0x00005555556f85c2 in main::{lambda()#2}::operator()() const ()
#11 0x00005555556f8fa7 in void folly::detail::function::FunctionTraits<void ()>::callSmallmain::{lambda()#2}(folly::detail::function::Data&) ()
#12 0x000055555582ec0b in folly::detail::function::FunctionTraits<void ()>::operator()() ()
#13 0x0000555555831b91 in wangle::ThreadPoolExecutor::runTask(std::shared_ptrwangle::ThreadPoolExecutor::Thread const&, wangle::ThreadPoolExecutor::Task&&) ()
#14 0x0000555555826903 in wangle::CPUThreadPoolExecutor::threadRun(std::shared_ptrwangle::ThreadPoolExecutor::Thread) ()
#15 0x000055555584028b in void std::__invoke_impl<void, void (wangle::ThreadPoolExecutor::
const&)(std::shared_ptrwangle::ThreadPoolExecutor::Thread), wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&>(std::__invoke_memfun_deref, void (wangle::ThreadPoolExecutor::* const&)(std::shared_ptrwangle::ThreadPoolExecutor::Thread), wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&) ()
#16 0x000055555583f86a in std::result_of<void (wangle::ThreadPoolExecutor::* const&(wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&))(std::shared_ptrwangle::ThreadPoolExecutor::Thread)>::type std::__invoke<void (wangle::ThreadPoolExecutor::* const&)(std::shared_ptrwangle::ThreadPoolExecutor::Thread), wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&>(void (wangle::ThreadPoolExecutor::* const&)(std::shared_ptrwangle::ThreadPoolExecutor::Thread), wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&) ()
#17 0x000055555583e8d3 in decltype (__invoke((this)._M_pmf, (forwardwangle::ThreadPoolExecutor*&)({parm#1}), (forward<std::shared_ptrwangle::ThreadPoolExecutor::Thread&>)({parm#1}))) std::_Mem_fn_base<void (wangle::ThreadPoolExecutor::)(std::shared_ptrwangle::ThreadPoolExecutor::Thread), true>::operator()<wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&>(wangle::ThreadPoolExecutor*&, std::shared_ptrwangle::ThreadPoolExecutor::Thread&) const ()
#18 0x000055555583cf0c in void std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::)(std::shared_ptrwangle::ThreadPoolExecutor::Thread)> (wangle::ThreadPoolExecutor, std::shared_ptrwangle::ThreadPoolExecutor::Thread)>::__call<void, , 0ul, 1ul>(std::tuple<>&&, std::_Index_tuple<0ul, 1ul>) ()
#19 0x000055555583b623 in void std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::)(std::shared_ptrwangle::ThreadPoolExecutor::Thread)> (wangle::ThreadPoolExecutor, std::shared_ptrwangle::ThreadPoolExecutor::Thread)>::operator()<, void>() ()
#20 0x00005555558393a8 in void folly::detail::function::FunctionTraits<void ()>::callBig<std::_Bind<std::_Mem_fn<void (wangle::ThreadPoolExecutor::)(std::shared_ptrwangle::ThreadPoolExecutor::Thread)> (wangle::ThreadPoolExecutor, std::shared_ptrwangle::ThreadPoolExecutor::Thread)> >(folly::detail::function::Data&) ()
#21 0x000055555582ec0b in folly::detail::function::FunctionTraits<void ()>::operator()() ()
#22 0x000055555582e03c in void std::_Bind_simple<folly::Function<void ()> ()>::_M_invoke<>(std::_Index_tuple<>) ()
#23 0x000055555582d7c4 in std::_Bind_simple<folly::Function<void ()> ()>::operator()() ()
#24 0x000055555582cf96 in std::thread::_State_impl<std::_Bind_simple<folly::Function<void ()> ()> >::_M_run() ()
#25 0x00007ffff5fb550f in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#26 0x00007ffff765870a in start_thread (arg=0x7fffec07e700) at pthread_create.c:333
#27 0x00007ffff5a240af in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

@abhiguru abhiguru changed the title random "Failed to resolve address Exception" after several succesfull resolutions random "Failed to resolve address Exception" after several successful resolutions Dec 8, 2016
@afrind
Copy link
Contributor

afrind commented Dec 8, 2016

What class are you using for address resolution? Can you write a small test program that resolves that address in a loop and doesn't do anything else proxygen related?

@abhiguru
Copy link
Author

abhiguru commented Dec 8, 2016

It fetches a live stream and the URIs keeps changing but the domain is the same I thought it would have been cached to save on the resolution request ? It does use FB Proxygen CurlClient I tried exception handling using the f.via().onError methods and others I came across in the documentation but have not yet been able to handle it. Can I email or message the sample ? It is short code but not as trivial as the URI fetching and URI downloading happens on separate threads connected by Queue

The exception seems to be thrown by - SocketAddress addr(url.getHost(), url.getPort(), true);

@afrind
Copy link
Contributor

afrind commented Dec 8, 2016

You probably don't want to be using folly::SocketAddress(hostname, port, true) for synchronous name resolution, as the sample does, unless you are doing it outside your event loop thread. In any case you can just replace it with gethostbyname and see if you have the same troubles.

@abhiguru
Copy link
Author

abhiguru commented Jan 2, 2017

I cached the socketAddress when the host is the same and moved it out of the event loop for first time resolution will close this for now.

@abhiguru abhiguru closed this as completed Jan 2, 2017
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