Migrate all production coroutine entry points from Boost.Coroutine
to C++20 std::coroutine using the CoroTask/CoroTaskRunner primitives:
- RipplePathFind: Replace Coro suspend/resume with co_await pattern,
add cv timeout for graceful shutdown.
- ServerHandler: Replace Coro-based processRequest with CoroTask,
simplify coroutine lifecycle management.
- GRPCServer: Replace Coro with CoroTask for streaming RPC handlers.
- Remove Coro usage from Context.h aggregate initialization.
- Add exception handling in coroutine bodies to prevent unhandled
exceptions from escaping the coroutine frame.
Add C++20 std::coroutine based task primitives for the JobQueue:
- CoroTask<T>: A coroutine return type with RAII ownership semantics
and symmetric transfer for efficient resumption.
- CoroTaskRunner: Manages coroutine lifecycle on the JobQueue with
suspend/resume tracking, LocalValue preservation, and graceful
shutdown support.
- JobQueueAwaiter: External awaiter combining yield+post atomically.
- yieldAndPost(): Inline awaiter workaround for GCC-12 codegen bug
where external awaiters at multiple co_await points corrupt the
coroutine state machine resume index.
- CoroTask_test: Comprehensive test suite covering task lifecycle,
suspend/resume, shutdown, and value-returning coroutines.
- BoostToStdCoroutineSwitchPlan.md: Migration plan documentation.
Comprehensive migration plan documenting the switch from
Boost.Coroutine2 to C++20 standard coroutines in rippled, including
research analysis, implementation phases, risk assessment, and
testing strategy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Throwing exceptions from code sometime confuses ASAN, as it cannot keep track of stack frames. This change therefore adds a macro to skip instrumentation around the `Throw` function.
ASAN wasn't able to keep track of `boost::coroutine` context switches, and would lead to many false positives being detected. By switching to `boost::coroutine2` and `ucontext`, ASAN is able to know about the context switches advertised by the `boost::fiber` class, which in turn leads to more cleaner ASAN analysis.