fix(profiling): upper bound on iterations for TaskInfo::unwind [backport 4.5]#16542
Merged
emmettbutler merged 1 commit into4.5from Feb 17, 2026
Merged
fix(profiling): upper bound on iterations for TaskInfo::unwind [backport 4.5]#16542emmettbutler merged 1 commit into4.5from
TaskInfo::unwind [backport 4.5]#16542emmettbutler merged 1 commit into4.5from
Conversation
) ## Description This PR updates the Task unwinding logic for the Profiler to have an upper bound on the number of (1) Tasks in the Task chain unwound (2) coroutines in the coroutine chain unwound. This is important because if somehow we have some memory corruption (very possible, as we don't take a snapshot of the interpreter memory but rather copy select "chunks" over time, and the state of Tasks can change as we copy those "chunks"), we could otherwise end up looping infinitely (which is bad for obvious reasons) and as a result try to add an infinite number of items to the Frame Stack (which is arguably significantly worse, as this would mean trying to allocate an infinite amount of memory 💣). We spotted this issue when we deployed `4.5.0rc2` to internal Rapid Python HTTP services, see IR-49542. Co-authored-by: thomas.kowalski <thomas.kowalski@datadoghq.com> (cherry picked from commit 0cfe067) Signed-off-by: Emmett Butler <emmett.butler321@gmail.com>
Codeowners resolved as |
4824cf7 to
8d30812
Compare
Contributor
|
✨ Fix all issues with BitsAI or with Cursor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #16510 to 4.5