alibaba / alibaba/Sentinel

异步调用时Context没有传递到子线程 | How to carry Sentinel context in async scenarios

Open
#2,746 1 comment 0 reactions 0 assignees View on GitHub
kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description
ContextUtil将Context保存在ThreadLocal中,当主线程在线程池中调用下游资源时,没有将ThreadLocal传递到下游的子线程,
下游资源在entry时由于没有Context会使用默认的ContextName创建,这样会导致基于链路入口的统计数据不准确

Contributor guide

Open the contributing guide

Research direction

Start by tracing ContextUtil's ThreadLocal usage through thread-pool calls and downstream resource entry. Done means the Sentinel context reaches the child thread so downstream entries retain the originating context and chain-based statistics remain accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.