You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/04/12 13:45:27 UTC
[PR] fix: support module-level @runnable with continue_tracing() [skywalking-python]
wu-sheng opened a new pull request, #391:
URL: https://github.com/apache/skywalking-python/pull/391
## Summary
- `@runnable` now returns a `_RunnableWrapper` object with a `continue_tracing()` method
- `continue_tracing()` captures the snapshot on the calling (parent) thread and returns a callable for use as `Thread` target
- Direct calls to a `@runnable`-decorated function still work as a local span (same as `@trace`)
- No global monkey-patching of `threading.Thread`
**Before (broken for module-level):**
```python
@runnable(op='/post')
def post():
requests.post(...)
thread = Thread(target=post) # snapshot was captured at import time — None
thread.start()
```
**After:**
```python
@runnable(op='/post')
def post():
requests.post(...)
thread = Thread(target=post.continue_tracing()) # snapshot captured here
thread.start()
```
Closes https://github.com/apache/skywalking/issues/11605
## Test plan
- [x] New test `tests/plugin/web/sw_threading/` — module-level `@runnable` with `continue_tracing()`, validates CrossThread ref
- [ ] Existing Flask test (`tests/plugin/web/sw_flask/`) — uses inline `@runnable`, backward compatible via direct `__call__`
- [ ] CI full matrix validation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: support module-level @runnable with continue_tracing() [skywalking-python]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #391:
URL: https://github.com/apache/skywalking-python/pull/391
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org