Repository navigation
Conversation
…protection to tracked fiber stacks Signed-off-by: Rueian Huang <[email protected]>
0fd4045 to
89ce643
Compare
Signed-off-by: Rueian Huang <[email protected]>
Signed-off-by: Rueian Huang <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request introduces fiber stack protection for CPython 3.14+ to prevent memory leaks in async actors running on Boost fibers. It tracks fiber stack allocations via a new FiberStackRegistry and TrackingFiberStackAllocator, and updates CPython's stack protection bounds using ReanchorStackProtectionToCurrentFiberStack at task entry and resumption points. The reviewer provided valuable feedback, identifying additional yielding points in _raylet.pyx (such as generator slot reservation and object consumption) that also need stack re-anchoring upon resumption, and suggesting a defensive GIL-check assertion to prevent unsafe usage of the re-anchoring function.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit 2d32247. Configure here.
Signed-off-by: Rueian Huang <[email protected]>
Keep the tracked-fiber stack protection implementation and drop the heuristic 32 KiB / 96 KiB used-stack estimates merged via ray-project#64772. Retain master's asyncio finalizer regression test and missing-API warning. Signed-off-by: Rueian Huang <[email protected]>
Signed-off-by: Rueian Huang <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
not stale |

Description
Following the idea of #64772, but instead of using precomputed 32k/96k magic numbers, this PR keeps track of each fiber stack space and re-anchors stack protection accordingly.
Related issues
#63290