-
-
Notifications
You must be signed in to change notification settings - Fork 95
[Engine] Add StackOverFlowError catch #374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds a try/catch around the recursive descendants traversal in AudienceManager to catch StackOverflowError, log a critical message with entry IDs, and rethrow. Core traversal logic and public API remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant AudienceManager
participant Traversal
participant Logger
Caller->>AudienceManager: descendants(klass)
AudienceManager->>Traversal: recurse through entries
alt Normal traversal
Traversal-->>AudienceManager: result
AudienceManager-->>Caller: List<Ref<E>>
else Stack overflow detected
Traversal--x AudienceManager: StackOverflowError
AudienceManager->>Logger: log severe with entry IDs
AudienceManager--x Caller: rethrow StackOverflowError
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds error handling for StackOverflowError in the AudienceManager to detect and log circular references in entry hierarchies. The change wraps the descendants function with a try-catch block to provide better debugging information when stack overflow occurs due to circular references.
- Adds StackOverflowError handling to prevent silent failures
- Provides detailed logging for debugging circular reference issues
engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/AudienceManager.kt
Outdated
Show resolved
Hide resolved
engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/entry/AudienceManager.kt
Show resolved
Hide resolved
Thank you copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds a simple catch (:
Merge whenever you want or are there any improvements needed?
Summary by CodeRabbit
Bug Fixes
Chores