Getting "Assertion `eventBase_->isInEventBaseThread()' failed" event from an EventBase thread

114 views
Skip to first unread message

Enis Söztutar

unread,
Jul 20, 2017, 9:50:25 PM7/20/17
to Folly: the Facebook Open-source LibrarY
I am facing a strange issue using wangle+folly with async socket IO. On socket close, I am seeing this: 


location-cache-test: io/async/AsyncSocket.cpp:996: virtual void folly::AsyncSocket::closeNow(): Assertion `eventBase_ == nullptr || eventBase_->isInEventBaseThread()' failed.

*** Aborted at 1500601416 (unix time) try "date -d @1500601416" if you are using GNU date ***

PC: @     0x7fad5876d418 gsignal

*** SIGABRT (@0x71fc) received by PID 29180 (TID 0x7faca71ec700) from PID 29180; stack trace: ***

    @     0x7fad598983d0 (unknown)

    @     0x7fad5876d418 gsignal

    @     0x7fad5876f01a abort

    @     0x7fad58765bd7 (unknown)

    @     0x7fad58765c82 __assert_fail

    @           0x56e521 folly::AsyncSocket::closeNow()

    @           0x565d45 folly::AsyncSocket::destroy()

    @           0x469022 std::_Sp_counted_deleter<>::_M_dispose()

    @           0x472b81 wangle::AsyncSocketHandler::~AsyncSocketHandler()

    @           0x479d30 wangle::ContextImpl<>::~ContextImpl()

    @           0x4791a5 wangle::PipelineBase::~PipelineBase()

    @           0x478ca1 wangle::Pipeline<>::~Pipeline()

    @           0x468834 wangle::BaseClientBootstrap<>::~BaseClientBootstrap()

    @           0x462faa _ZZN5hbase13RpcConnection5CloseEvENKUlvE_clEv

    @           0x58fe57 folly::EventBase::runImmediatelyOrRunInEventBaseThreadAndWait()

    @           0x4626f3 hbase::RpcConnection::Close()

    @           0x4890af hbase::ClientDispatcher::CloseAndCleanUpCalls()

    @           0x489609 hbase::ClientDispatcher::close()

    @           0x489692 hbase::ClientDispatcher::close()

    @           0x462ee8 _ZZN5hbase13RpcConnection5CloseEvENKUlvE_clEv

    @           0x5894b0 _ZN5folly6detail8function14FunctionTraitsIFvvEE9callSmallIZNS_9EventBase27runInEventBaseThreadAndWaitENS_11FunctionRefIS3_EEEUlvE_EEvRNS1_4DataE

    @           0x591ca9 folly::NotificationQueue<>::Consumer::consumeMessages()

    @           0x76660c event_base_loop

    @           0x58b7c5 folly::EventBase::loopBody()

    @           0x58d697 folly::EventBase::loopForever()

    @           0x4a2209 wangle::IOThreadPoolExecutor::threadRun()

    @           0x4ab9c2 folly::detail::function::FunctionTraits<>::callBig<>()

    @     0x7fad59dc5c70 (unknown)

    @     0x7fad5988e6fa start_thread

    @     0x7fad5883eb5d clone

    @                0x0 (unknown)

Aborted (core dumped)


But notice that this is already running in a wangle::IOThreadPoolExecutor, and there is even the call EventBase::runImmediateOrRunInEventBaseThreadAndWait() call in the stack. Anybody has an insight into this behavior? 

Previously, I have seen similar behavior from EventBase::isInEventBaseThread() when used with a wangle::IOThreadPool with more than 1 threads. But in this case, this pool only have 1 thread. Any feedback is appreciated. 

Enis


Mounesh Badiger

unread,
Jan 27, 2019, 12:30:01 PM1/27/19
to Folly: the Facebook Open-source LibrarY
Hi Enis, Did you able to solve this ? we are also hitting this issue. 
Reply all
Reply to author
Forward
0 new messages