-
Notifications
You must be signed in to change notification settings - Fork 2
bugfix: include streaming procedure errors in traces #121
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
bugfix: include streaming procedure errors in traces #121
Conversation
|
Current dependencies on/for this PR: This comment was autogenerated by Freephite. |
5786b26 to
046355d
Compare
7e4549d to
e2432af
Compare
|
@blast-hardcheese can I dump this on you please? :D |
320fb9b to
da90ab1
Compare
blast-hardcheese
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.
Trending in the right direction, for sure. Great call-out wrt the asyncio.wait not raising the captured exceptions. In a sense, it can't do that sensibly.
Otoh, this really makes me want a linting rule for "you called a function that returned a value, but you didn't receive it." Kind of challenging in Python due to the dynamic and multipurpose nature of many functions, but it would have caught this.
blast-hardcheese
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.
I intended to approve. Pardon.
da90ab1 to
e308d40
Compare
Why
Streaming response procedures don't raise errors like the other procedures, instead the errors are included in the
AsyncIterator.Also fixes issues with using contextvars + async generators.
What changed
RiverError, if so, record it on the spanstart_spaninstead ofstart_as_current_span, the latter resets a contextvar in itsfinallyclause which is invalid to do for async generators as the async generator's finalizers run in a different contextTest plan