alibaba / Sentinel

A powerful flow control component enabling reliability, resilience and monitoring for microservices. (面向云原生微服务的高可用流控防护组件)
https://sentinelguard.io/
Apache License 2.0
22.4k stars 8.02k forks source link

sentinel springwebmvc不支持异步async请求 #2447

Open halfciga opened 2 years ago

halfciga commented 2 years ago

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

Linzyoo commented 2 months ago

It seems fixed by https://github.com/alibaba/Sentinel/pull/3440