ZEALi opened a new pull request, #311:
URL: https://github.com/apache/skywalking-python/pull/311

   The _skywalking.trace.context.SpanContext.active_span()_ method has been 
refactored in v1.0.0. Its equivalent method has been changed to _peek()_ . When 
_peek()_ returns None, the _active_span()_ method throws **IllegalStateError** 
exception directly. 
   
   This change is not backward compatible, SOME plugins that rely on the 
returned None value of _active_span()_ WILL be broken ( sw_flask, sw_sanic, 
sw_tornado, sw_django, etc.).
   
   For example, when running Flask by **gunicorn** which not monkey-patched as 
well as for sw_http_server plugin, calling _get_context().active_span_ in 
__sw_handle_exception()_ will raise an IllegalStateError exception directly and 
break the original logic of the container's _handle_exception()_ .
   
   In v0.8.0, no exception was thrown, so the caller could check if entry_span 
is not None and perform further processing. 
   
   Therefore, I suggest retaining the behavioral pattern of the _active_span()_ 
method in v0.8.0 , and providing parameters in the added _peek()_ method to 
support scenarios where exceptions need to be thrown (such as in sw_logging / 
sw_loguru).
   
   <!--
       ⚠️ Please make sure to read this template first, pull requests that 
don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. 
<framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   - [ ] Update the 
[`CHANGELOG.md`](https://github.com/apache/skywalking-python/blob/master/CHANGELOG.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to