-
Notifications
You must be signed in to change notification settings - Fork 966
Preserve stack trace for CancelledSubscriptionException
#6525
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
Motivation: When a `CancelledSubscriptionException` was raised, it was created without a stack trace for performance reasons. This made it difficult for developers to debug the root cause of a subscription cancellation. Modifications: - Used `CancelledSubscriptionException.get()` when creating a `CloseEvent`. - This method leverages the configured `verboseExceptionSampler` to determine whether a full stack trace should be captured and preserved. Result: - Developers can now obtain a full stack trace for `CancelledSubscriptionException` by configuring the `verboseExceptionSampler`.
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (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). (13)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
ikhoon
left a comment
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.
👍👍
| if (cause == CancelledSubscriptionException.INSTANCE) { | ||
| return CANCELLED_CLOSE; | ||
| } else if (cause == AbortedStreamException.INSTANCE) { | ||
| return ABORTED_CLOSE; | ||
| } else { |
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.
As the stacktrace of cause is already empty, I think we can keep the original behavior.
| final SubscriptionImpl subscription = this.subscription; | ||
| assert subscription != null; | ||
| notifySubscriberOfCloseEvent(subscription, CANCELLED_CLOSE); | ||
| notifySubscriberOfCloseEvent(subscription, new CloseEvent(CancelledSubscriptionException.get())); |
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.
It would be better to use cached CloseEvent if CancelledSubscriptionException.get() returns CancelledSubscriptionException.INSTANCE.
| notifySubscriberOfCloseEvent(subscription, new CloseEvent(CancelledSubscriptionException.get())); | |
| notifySubscriberOfCloseEvent(subscription, newCloseEvent(CancelledSubscriptionException.get())); |
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.
Thanks! updated. 😉
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6525 +/- ##
============================================
- Coverage 74.46% 74.18% -0.29%
- Complexity 22234 23393 +1159
============================================
Files 1963 2102 +139
Lines 82437 87568 +5131
Branches 10764 11496 +732
============================================
+ Hits 61385 64960 +3575
- Misses 15918 17129 +1211
- Partials 5134 5479 +345 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation:
When a
CancelledSubscriptionExceptionwas raised, it was created without a stack trace for performance reasons. This made it difficult for developers to debug the root cause of a subscription cancellation.Modifications:
CancelledSubscriptionException.get()when creating aCloseEvent.verboseExceptionSamplerto determine whether a full stack trace should be captured and preserved.Result:
CancelledSubscriptionExceptionby configuring theverboseExceptionSampler.