WTRU destructor can be roped into app eviction

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines, Storage Engines - Server Integration
    • SESI - 2025-06-24
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      While doing other interruptibility testing it was noted that the WTRU destructor can be roped into app eviction, regardless of existing eviction settings.

       

      The issue is WiredTigerConnection::_releaseSession calls sizeStorerPeriodicFlush(). If a sufficient interval has elapsed, that thread will call 
      WiredTigerSizeStorer::flush which uses a session which does not inherit any configuration from the WTRU. As a result, any thread going through this path can hit app eviction.
       
      Possible solutions: * Propagate the cache_max_wait_ms down to flush() so that operations that need to abort quickly can opt out

      • Set the cache_max_wait_ms unconditionally in this path

       

      Stack:

      #0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0xfcc08d0052c8, op=137, expected=0, futex_word=0x500c3fb53654) at ./nptl/futex-internal.c:57
      #1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0xfcc08d0052c8, clockid=-1211327016, expected=0, futex_word=0x500c3fb53654) at ./nptl/futex-internal.c:87
      #2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x500c3fb53654, expected=expected@entry=0, clockid=clockid@entry=1, abstime=abstime@entry=0xfcc08d0052c8, private=private@entry=0) at ./nptl/futex-internal.c:139
      #3  0x0000fcc0b7cccc10 in __pthread_cond_wait_common (abstime=0xfcc08d0052c8, clockid=1, mutex=0x500c3fb535f8, cond=0x500c3fb53628) at ./nptl/pthread_cond_wait.c:503
      #4  ___pthread_cond_timedwait64 (cond=0x500c3fb53628, mutex=0x500c3fb535f8, abstime=0xfcc08d0052c8) at ./nptl/pthread_cond_wait.c:652
      #5  0x0000c336665ab7dc in __wt_cond_wait_signal (session=0x500c3c023320, cond=0x500c3fb535f0, usecs=10000, run_func=0x0, signalled=0xfcc08d005727) at src/third_party/wiredtiger/src/os_posix/os_mtx_cond.c:115
      #6  0x0000c33666415a88 in __wt_cond_wait (session=0x500c3c023320, cond=0x500c3fb535f0, usecs=10000, run_func=0x0) at src/third_party/wiredtiger/src/include/misc_inline.h:21
      #7  0x0000c336664144d4 in __wti_evict_app_assist_worker (session=0x500c3c023320, busy=false, readonly=false, interruptible=true) at src/third_party/wiredtiger/src/evict/evict_lru.c:2950
      #8  0x0000c33666586974 in __wt_evict_app_assist_worker_check (session=0x500c3c023320, busy=false, readonly=false, interruptible=true, didworkp=0x0) at src/third_party/wiredtiger/src/include/../evict/evict_inline.h:729
      #9  0x0000c33666587384 in __wt_txn_rollback (session=0x500c3c023320, cfg=0xfcc08d007e10) at src/third_party/wiredtiger/src/txn/txn.c:2275
      #10 0x0000c33666504834 in __session_rollback_transaction (wt_session=0x500c3c023320, config=0x0) at src/third_party/wiredtiger/src/session/session_api.c:1963
      #11 0x0000c33666141d60 in mongo::WiredTigerSession::rollback_transaction<decltype(nullptr)>(decltype(nullptr)&&) (this=0xfcc08d008368, args=<error reading variable: Attempt to dereference a generic pointer.>) at src/mongo/db/storage/wiredtiger/wiredtiger_session.h:146
      #12 0x0000c33666141830 in mongo::WiredTigerBeginTxnBlock::~WiredTigerBeginTxnBlock (this=0xfcc08d008520) at src/mongo/db/storage/wiredtiger/wiredtiger_begin_transaction_block.cpp:138
      #13 0x0000c336661f1478 in mongo::WiredTigerSizeStorer::flush (this=0x500c3fb50420, syncToDisk=false) at src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp:218
      #14 0x0000c33666186438 in mongo::WiredTigerKVEngine::syncSizeInfo (this=0x500c3f86a700, sync=false) at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:1518
      #15 0x0000c33666193ca4 in mongo::WiredTigerKVEngine::sizeStorerPeriodicFlush (this=0x500c3f86a700) at src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp:3118
      #16 0x0000c336661463ec in mongo::WiredTigerConnection::_releaseSession (this=0x500c3fb2a960, session=...) at src/mongo/db/storage/wiredtiger/wiredtiger_connection.cpp:259
      #17 0x0000c336661b8104 in mongo::WiredTigerManagedSession::_release (this=0x500c2e1fe6e8) at src/mongo/db/storage/wiredtiger/wiredtiger_managed_session.cpp:46
      #18 0x0000c336661b8088 in mongo::WiredTigerManagedSession::~WiredTigerManagedSession (this=0x500c2e1fe6e8) at src/mongo/db/storage/wiredtiger/wiredtiger_managed_session.cpp:41
      #19 0x0000c3366613e7b0 in mongo::WiredTigerRecoveryUnitBase::~WiredTigerRecoveryUnitBase (this=0x500c2e1fe600) at src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h:72
      #20 0x0000c336661de6bc in mongo::WiredTigerRecoveryUnit::~WiredTigerRecoveryUnit (this=0x500c2e1fe600) at src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:127
      #21 0x0000c336661de84c in mongo::WiredTigerRecoveryUnit::~WiredTigerRecoveryUnit (this=0x500c2e1fe600) at src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp:124
      #22 0x0000c33665fb2e10 in std::default_delete<mongo::RecoveryUnit>::operator() (this=0x500c2e9f7580, __ptr=0x500c2e1fe600) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:93
      #23 0x0000c33665fb2a94 in std::unique_ptr<mongo::RecoveryUnit, std::default_delete<mongo::RecoveryUnit> >::~unique_ptr (this=0x500c2e9f7580) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:398
      #24 0x0000c3366ce7f710 in mongo::decorable_detail::LifecycleOperations::getDtor<std::unique_ptr<mongo::RecoveryUnit, std::default_delete<mongo::RecoveryUnit> > >()::{lambda(void*)#1}::operator()(void*) const (this=0xfcc08d008a47, p=0x500c2e9f7580) at src/mongo/util/decorable.h:112
      #25 0x0000c3366ce7f6c8 in mongo::decorable_detail::LifecycleOperations::getDtor<std::unique_ptr<mongo::RecoveryUnit, std::default_delete<mongo::RecoveryUnit> > >()::{lambda(void*)#1}::__invoke(void*) (p=0x500c2e9f7580) at src/mongo/util/decorable.h:111
      #26 0x0000c3366cdbad04 in mongo::decorable_detail::DecorationBuffer<mongo::OperationContext>::_tearDownParts (this=0x500c3512b1e8, count=42) at src/mongo/util/decorable.h:388
      #27 0x0000c3366cdbabcc in mongo::decorable_detail::DecorationBuffer<mongo::OperationContext>::~DecorationBuffer (this=0x500c3512b1e8) at src/mongo/util/decorable.h:327
      #28 0x0000c3366cdbac10 in mongo::Decorable<mongo::OperationContext>::~Decorable (this=0x500c3512b1e0) at src/mongo/util/decorable.h:440
      #29 0x0000c3366cdb635c in mongo::OperationContext::~OperationContext (this=0x500c3512b180) at src/mongo/db/operation_context.cpp:90
      #30 0x0000c3366cdd1dd4 in mongo::ServiceContext::OperationContextDeleter::operator() (this=0x500c3fa8dd98, opCtx=0x500c3512b180) at src/mongo/db/service_context.cpp:349
      #31 0x0000c336635594c4 in std::unique_ptr<mongo::OperationContext, mongo::ServiceContext::OperationContextDeleter>::~unique_ptr (this=0x500c3fa8dd98) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:398
      #32 0x0000c3366be05790 in mongo::transport::SessionWorkflow::Impl::WorkItem::~WorkItem (this=0x500c3fa8dd80) at src/mongo/transport/session_workflow.cpp:559
      #33 0x0000c3366be05748 in std::default_delete<mongo::transport::SessionWorkflow::Impl::WorkItem>::operator() (this=0x500c3fb97de8, __ptr=0x500c3fa8dd80) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:93
      #34 0x0000c3366be0569c in std::__uniq_ptr_impl<mongo::transport::SessionWorkflow::Impl::WorkItem, std::default_delete<mongo::transport::SessionWorkflow::Impl::WorkItem> >::reset (this=0x500c3fb97de8, __p=0x0) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:205
      #35 0x0000c3366be0af14 in std::unique_ptr<mongo::transport::SessionWorkflow::Impl::WorkItem, std::default_delete<mongo::transport::SessionWorkflow::Impl::WorkItem> >::reset (this=0x500c3fb97de8, __p=0x0) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:503
      #36 0x0000c3366be04838 in std::unique_ptr<mongo::transport::SessionWorkflow::Impl::WorkItem, std::default_delete<mongo::transport::SessionWorkflow::Impl::WorkItem> >::operator=(decltype(nullptr)) (this=0x500c3fb97de8) at external/mongo_toolchain_v5/stow/gcc-v5/include/c++/14.2.0/bits/unique_ptr.h:436
      #37 0x0000c3366be02930 in mongo::transport::SessionWorkflow::Impl::_scheduleIteration()::$_0::operator()(mongo::Status) const (this=0x500c3421c2c8, status=Status::OK()) at src/mongo/transport/session_workflow.cpp:828
      #38 0x0000c3366be02718 in mongo::unique_function<void (mongo::Status)>::makeImpl<mongo::transport::SessionWorkflow::Impl::_scheduleIteration()::$_0>(mongo::transport::SessionWorkflow::Impl::_scheduleIteration()::$_0&&)::SpecificImpl::call(mongo::Status&&) (this=0x500c3421c2c0, args=Status::OK()) at src/mongo/util/functional.h:262
      #39 0x0000c336635a63e4 in mongo::unique_function<void (mongo::Status)>::operator()(mongo::Status) const (this=0x500c3fa8dbe0, args=Status::OK()) at src/mongo/util/functional.h:220
      #40 0x0000c3366be083dc in mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}::operator()(mongo::Status)::{lambda()#1}::operator()() const (this=0xfcc08d008e88) at src/mongo/transport/session_workflow.cpp:483
      #41 0x0000c3366be0833c in mongo::ClientStrand::run<mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}::operator()(mongo::Status)::{lambda()#1}>(mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}::operator()(mongo::Status)::{lambda()#1}) (this=0x500c3424de00, task=...) at src/mongo/db/client_strand.h:177
      #42 0x0000c3366be082ec in mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}::operator()(mongo::Status) (this=0x500c3fa8dbc8, st=Status::OK()) at src/mongo/transport/session_workflow.cpp:483
      #43 0x0000c3366be081c4 in mongo::unique_function<void (mongo::Status)>::makeImpl<mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}>(mongo::transport::SessionWorkflow::Impl::_captureContext(mongo::unique_function<void (mongo::Status)>)::{lambda(mongo::Status)#1}&&)::SpecificImpl::call(mongo::Status&&) (this=0x500c3fa8dbc0, args=Status::OK()) at src/mongo/util/functional.h:262
      #44 0x0000c336635a63e4 in mongo::unique_function<void (mongo::Status)>::operator()(mongo::Status) const (this=0x500c2e1fe3b8, args=Status::OK()) at src/mongo/util/functional.h:220
      #45 0x0000c3366bf26e08 in mongo::transport::service_executor_synchronous_detail::ServiceExecutorSyncImpl::SharedState::WorkerThreadInfo::run (this=0x500c34266180) at src/mongo/transport/service_executor_synchronous.cpp:116
      #46 0x0000c3366bf23b54 in mongo::transport::service_executor_synchronous_detail::ServiceExecutorSyncImpl::SharedState::schedule(mongo::unique_function<void (mongo::Status)>, mongo::StringData)::$_0::operator()() const (this=0x500c3424ef38) at src/mongo/transport/service_executor_synchronous.cpp:152
      #47 0x0000c3366bf24c08 in mongo::unique_function<void ()>::makeImpl<mongo::transport::service_executor_synchronous_detail::ServiceExecutorSyncImpl::SharedState::schedule(mongo::unique_function<void (mongo::Status)>, mongo::StringData)::$_0>(mongo::transport::service_executor_synchronous_detail::ServiceExecutorSyncImpl::SharedState::schedule(mongo::unique_function<void (mongo::Status)>, mongo::StringData)::$_0&&)::SpecificImpl::call() (this=0x500c3424ef30) at src/mongo/util/functional.h:262
      #48 0x0000c33663f838ec in mongo::unique_function<void ()>::operator()() const (this=0x500c3fba7f38) at src/mongo/util/functional.h:220
      #49 0x0000c3366bf2a248 in mongo::transport::launchServiceWorkerThread(mongo::unique_function<void ()>)::$_0::operator()() (this=0x500c3fba7f28) at src/mongo/transport/service_executor_utils.cpp:119
      #50 0x0000c3366bf2a1fc in mongo::unique_function<void ()>::makeImpl<mongo::transport::launchServiceWorkerThread(mongo::unique_function<void ()>)::$_0>(mongo::transport::launchServiceWorkerThread(mongo::unique_function<void ()>)::$_0&&)::SpecificImpl::call() (this=0x500c3fba7f20) at src/mongo/util/functional.h:262
      #51 0x0000c33663f838ec in mongo::unique_function<void ()>::operator()() const (this=0x500c3fe2a630) at src/mongo/util/functional.h:220
      #52 0x0000c3366bf29e88 in mongo::transport::(anonymous namespace)::runFunc (ctx=0x500c3fe2a630) at src/mongo/transport/service_executor_utils.cpp:63
      #53 0x0000fcc0b7ccd5c8 in start_thread (arg=0x0) at ./nptl/pthread_create.c:442
      #54 0x0000fcc0b7d35edc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79 

            Assignee:
            Aaron Balsara
            Reporter:
            Aaron Balsara
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: