-
Notifications
You must be signed in to change notification settings - Fork 98
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
Improving Exceptions bubbling #1397
Comments
This is a valid issue. However we are not likely to do a large change to the repo at this point (which requires discussing and finding a somewhat better solution, rewrite the code generator, regenerate all the underlying code (all those Develop focus is shifted to next generate SDK https://aka.ms/azsdk/java/mgmt (migration should be easy, though A similar call of
|
Thanks @weidongxu-microsoft. In fact, I discovered this alternate Azure Management library very recently. The README for this repository indicates there is a more recent alternative. But it was not crystal-clear to myself. I interprete Would you mind making the point this library is kind of deprecated clearer? Deprecation is maybe too strong for now, but you get my point. |
Well, it is not deprecated (yet). It is kind of in this state: if we have bug or improvement related to security, we fix here and on the new repo; if we have new feature or other improvement, we likely only put it in the new repo. |
Is your feature request related to a problem? Please describe.
In many places, any sort of exceptions is bubbled without a context, leaving the stack-trace reader with a partial stack difficult to process
Describe the solution you'd like
I would like Exceptions to be properly chained, so that finally reported Exceptions holds a proper chain of Cause, enabling retracing the whole chain of calls.
Sorry for the quite long ticket while I suspect it may be rejected right-away, I tried to be quite exhaustive in my analysis.
Typically, I consider a piece of code like:
I end with a failure in ResourceGroupsInner:
This leads to stacks like:
My main issue here is that I capture an Exception is some sort of generic Exception handler (e.g. a Spring @ControllerAdvice). However, the stack does not even report my class having called
azure .resourceGroups().list()
.A richer stack would be available by wrapping the bubble-ed exception in ResourceGroupsInner.listSinglePageAsync :
However, this would not produce a full stack due to :
In my case, the stack looks like:
Hence, the calling thread own stack is not properly bubbled due to:
The questions of exception bubbling in Rxjava is regularly considered (e.g. ReactiveX/RxJava#969).
However, blocking statements are considered inappropriate for production:
BlockingObservable:
Should I consider this as an issue in Rxjava BlockingObservable ? (i.e. BlockingObservable does not propagate properly exceptions from different threads, hence losing the stack for calling thread?)
Or should I consider this should be managed by calling libraries (here Azure libraries), to catch systematically such exceptions, and re-wrap them? However, this would lead to the inner exception to be be available directly (still being available through the chain of causes).
In the second case, it would lead in any sync call to something like:
ResourceGroupsInner:
The text was updated successfully, but these errors were encountered: