Make RETRY_COVERAGE_TRACKING also able to detect nested withRetry#14138
Open
thirtiseven wants to merge 3 commits intoNVIDIA:mainfrom
Open
Make RETRY_COVERAGE_TRACKING also able to detect nested withRetry#14138thirtiseven wants to merge 3 commits intoNVIDIA:mainfrom
thirtiseven wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Haoyang Li <[email protected]>
Collaborator
Author
|
@greptileai full review |
Contributor
Greptile OverviewGreptile SummaryThis PR extends the Key Changes:
Implementation:
The implementation correctly leverages the existing retry block depth tracking mechanism that was already in place for the coverage tracker. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User Code
participant Outer as Outer withRetry
participant Tracker as RetryStateTracker
participant Alloc as AllocationRetryCoverageTracker
participant Inner as Inner withRetry
User->>Outer: withRetry(data) { fn }
Outer->>Tracker: enterRetryBlock()
Note over Tracker: depth = 1
Outer->>User: execute fn(data)
User->>Inner: withRetry(data2) { fn2 }
Inner->>Tracker: enterRetryBlock()
Note over Tracker: depth = 2 (NESTED!)
Inner->>User: execute fn2(data2)
User->>Alloc: checkAllocation(kind)
Alloc->>Tracker: getRetryBlockDepth()
Tracker-->>Alloc: depth = 2
Note over Alloc: depth > 1, log as NESTED
Alloc->>Alloc: writeToFile("NESTED,...")
User-->>Inner: return result
Inner->>Tracker: exitRetryBlock()
Note over Tracker: depth = 1
Inner-->>User: return result
User-->>Outer: return result
Outer->>Tracker: exitRetryBlock()
Note over Tracker: depth = 0
Outer-->>User: return result
|
sql-plugin/src/main/scala/com/nvidia/spark/rapids/AllocationRetryCoverageTracker.scala
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/AllocationRetryCoverageTracker.scala
Outdated
Show resolved
Hide resolved
…tryCoverageTracker.scala Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Collaborator
|
NOTE: release/26.02 has been created from main. Please retarget your PR to release/26.02 if it should be included in the release. |
Collaborator
Author
|
@greptileai full review |
Signed-off-by: Haoyang Li <[email protected]>
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.
Contributes to #14136
Description
This PR adds a new type, NESTED, to SPARK_RAPIDS_RETRY_COVERAGE_TRACKING, enabling the detection of nested withRetry calls, which can indicate potential performance issues.
Checklists
(Please explain in the PR description how the new code paths are tested, such as names of the new/existing tests that cover them.)