alibaba / alibaba/Sentinel

sentinel springwebmvc不支持异步async请求

Open
#2,447 1 comment 0 reactions 0 assignees View on GitHub
area/integrations good first issue kind/bug
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

我们在Controller使用了WebAsyncTask的异步返回方式,这种情况下,AbstractSentinelInterceptor中的prehandle会执行两次,rckey变成了2,但是afterCompletion只会执行一次(而且还是在另外一个线程请求的),导致clean的逻辑无法执行,这样entry和context在threadlocal中一直无法清除,最终oom

Contributor guide

Open the contributing guide

Research direction

Start by tracing WebAsyncTask handling through AbstractSentinelInterceptor, especially the preHandle and afterCompletion callbacks and their ThreadLocal cleanup. Reproduce the asynchronous request and verify that repeated interception and completion on another thread do not leave entry or context state behind.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.