Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    1345a02b
    DRTVWR-476: Terminate long-lived coroutines to avoid shutdown crash. · 1345a02b
    Nat Goodspeed authored
    Add LLCoros::TempStatus instances around known suspension points so
    printActiveCoroutines() can report what each suspended coroutine is waiting
    for.
    
    Similarly, sprinkle checkStop() calls at known suspension points.
    
    Make LLApp::setStatus() post an event to a new LLEventPump "LLApp" with a
    string corresponding to the status value being set, but only until
    ~LLEventPumps() -- since setStatus() also gets called very late in the
    application's lifetime.
    
    Make postAndSuspendSetup() (used by postAndSuspend(), suspendUntilEventOn(),
    postAndSuspendWithTimeout(), suspendUntilEventOnWithTimeout()) add a listener
    on the new "LLApp" LLEventPump that pushes the new LLCoros::Stopping exception
    to the coroutine waiting on the LLCoros::Promise. Make it return the new
    LLBoundListener along with the previous one.
    
    Accordingly, make postAndSuspend() and postAndSuspendWithTimeout() store the
    new LLBoundListener returned by postAndSuspendSetup() in a LLTempBoundListener
    (as with the previous one) so it will automatically disconnect once the wait
    is over.
    
    Make each LLCoprocedurePool instance listen on "LLApp" with a listener that
    closes the queue on which new work items are dispatched. Closing the queue
    causes the waiting dispatch coroutine to terminate. Store the connection in an
    LLTempBoundListener on the LLCoprocedurePool so it will disconnect
    automatically on destruction.
    
    Refactor the loop in coprocedureInvokerCoro() to instantiate TempStatus around
    the suspending call.
    
    Change a couple spammy LL_INFOS() calls to LL_DEBUGS(). Give all logging calls
    in that module a "CoProcMgr" tag to make it straightforward to re-enable the
    LL_DEBUGS() calls as desired.
    1345a02b
    History
    DRTVWR-476: Terminate long-lived coroutines to avoid shutdown crash.
    Nat Goodspeed authored
    Add LLCoros::TempStatus instances around known suspension points so
    printActiveCoroutines() can report what each suspended coroutine is waiting
    for.
    
    Similarly, sprinkle checkStop() calls at known suspension points.
    
    Make LLApp::setStatus() post an event to a new LLEventPump "LLApp" with a
    string corresponding to the status value being set, but only until
    ~LLEventPumps() -- since setStatus() also gets called very late in the
    application's lifetime.
    
    Make postAndSuspendSetup() (used by postAndSuspend(), suspendUntilEventOn(),
    postAndSuspendWithTimeout(), suspendUntilEventOnWithTimeout()) add a listener
    on the new "LLApp" LLEventPump that pushes the new LLCoros::Stopping exception
    to the coroutine waiting on the LLCoros::Promise. Make it return the new
    LLBoundListener along with the previous one.
    
    Accordingly, make postAndSuspend() and postAndSuspendWithTimeout() store the
    new LLBoundListener returned by postAndSuspendSetup() in a LLTempBoundListener
    (as with the previous one) so it will automatically disconnect once the wait
    is over.
    
    Make each LLCoprocedurePool instance listen on "LLApp" with a listener that
    closes the queue on which new work items are dispatched. Closing the queue
    causes the waiting dispatch coroutine to terminate. Store the connection in an
    LLTempBoundListener on the LLCoprocedurePool so it will disconnect
    automatically on destruction.
    
    Refactor the loop in coprocedureInvokerCoro() to instantiate TempStatus around
    the suspending call.
    
    Change a couple spammy LL_INFOS() calls to LL_DEBUGS(). Give all logging calls
    in that module a "CoProcMgr" tag to make it straightforward to re-enable the
    LL_DEBUGS() calls as desired.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
llapp.cpp 29.35 KiB