Repository navigation
v2.0.3 – Nested Coroutine Execution Fix
Release description:
This release introduces a critical fix enabling proper execution of nested coroutines (co_await task1() inside another co_await task2()), which previously caused suspended tasks not to resume or terminate incorrectly.
🧩 Core Changes
- Fixed coroutine chaining logic in
AwaitableandAwaitableFrame:- Correctly links parent and child coroutine handles (
prev_/next_). - Ensures child coroutines are properly scheduled only when not I/O-bound (
AwaitableFrame<T>vs.AwaitableIOFrame<T>). - Prevents unwanted automatic resumption of I/O coroutines that must await epoll triggers.
- Correctly links parent and child coroutine handles (
- Removed redundant
resume()calls inawait_resume()forvoidtasks to avoid unintended re-entry. - Added type traits to distinguish normal coroutine frames from I/O frames at compile time.
⚙️ Impact
- Nested coroutine flows (e.g.,
co_await accept(); co_await some_task();) now execute in sequence as expected. - I/O coroutines (
async_read,async_write, etc.) remain event-driven and suspended until triggered by epoll. - Eliminates potential infinite loops and early task execution in multi-await chains.
✅ Recommended Action
Update to this version if your code involves layered coroutine awaits, especially around asynchronous socket operations or custom Awaitable tasks.