Files
turso/core
Pekka Enberg cdd6f6a45d core/io: Fix completion group parent notification
The previous implementation of CompletionGroup would call the group's
callback function directly when the last completion finished:

    if prev == 1 {
        let group_result = group.result.get().and_then(|e| *e);
        (group.complete)(group_result.map_or(Ok(0), Err));
    }

This broke nested completion groups because parent groups track their
children via the Completion::callback() method. By calling the function
pointer directly, we bypassed the completion chain and parent groups
never received notification that their child had completed.

The fix stores a reference to the group's own Completion object in
self_completion during build(). When the last child finishes, we call
group_completion.callback() instead of invoking the function directly.
This properly propagates through the completion hierarchy, ensuring
parent groups decrement their outstanding count and eventually complete.

This matches the behavior of individual completions and maintains the
invariant that all completions notify their parents through the unified
callback() mechanism.
2025-10-15 10:47:16 +03:00
..
2025-10-06 13:21:45 +04:00
2025-10-12 16:38:12 +05:30
2025-09-24 18:06:55 -03:00
2025-06-30 10:01:03 +03:00
fmt
2025-10-14 22:22:14 +04:00
2025-01-28 14:55:38 -05:00
2025-10-07 16:22:20 -04:00
2025-01-28 14:55:38 -05:00
2025-09-30 14:52:59 +04:00
2025-10-09 19:00:40 +03:00
2025-09-22 16:37:31 +03:00
2025-10-12 18:02:03 +05:30
2025-06-30 09:54:13 +03:00
2025-09-23 14:22:02 -04:00