Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@Aspect
public class SentinelResourceAspect extends AbstractSentinelAspectSupport {

@Pointcut("@annotation(com.alibaba.csp.sentinel.annotation.SentinelResource)")
@Pointcut("execution(* *(..)) && @annotation(com.alibaba.csp.sentinel.annotation.SentinelResource)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct fix. In native AspectJ (CTW/LTW), an unqualified @annotation(...) pointcut matches multiple join point kinds — including both call and execution — so the advice fires twice per invocation, double-counting SphU.entry() and breaking thread-based flow control. Restricting to execution(* *(..)) restores the intended single-firing semantics while remaining a no-op for Spring AOP users (proxy-based AOP only supports execution join points anyway).

Optional follow-up (non-blocking): if feasible, a regression test exercising the aspect under load-time weaving would guard against regressions, though that may be non-trivial to wire into the current test setup.

public void sentinelResourceAnnotationPointcut() {
}

Expand Down