alibaba / alibaba/Sentinel

Circuit breaking was not triggered with Spring WebFlux and reactive WebClient

Open
#1,401 20 comments 0 reactions 0 assignees View on GitHub
area/circuit-breaking kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *bug report* or *feature request*

### Describe what happened (or what feature you want)
SphU.asyncEntry 接口无法block

### Describe what you expected to happen
我写了个服务接口,delay 1秒
![image](https://user-images.githubusercontent.com/5616997/79119717-9fb8bb00-7dc3-11ea-9792-617bfff96e69.png)
使用如下的方法测试,资源设置50ms超时,时间窗口2秒
![image](https://user-images.githubusercontent.com/5616997/79119772-ba8b2f80-7dc3-11ea-9b89-fbbd2a7ac6c3.png)

日志显示
没有请求block,所有请求都成功到达后端
![image](https://user-images.githubusercontent.com/5616997/79119916-12299b00-7dc4-11ea-972b-9ce1ee0936df.png)

### How to reproduce it (as minimally and precisely as possible)

1. 写一个缓慢的服务端,我采用delay 1秒模拟
2. 使用webflux webclient 请求服务,订阅里close AsyncEntry
3. 循环调用多次,我测试是调用100次

### Tell us your environment
jdk 14, kotlin 1.3.71, win 10 64 bit

### Anything else we need to know?

Contributor guide

Open the contributing guide

Research direction

Start with the SphU.asyncEntry call and the Spring WebFlux WebClient subscription flow described in the reproduction steps, including where AsyncEntry is closed. Reproduce the delayed one-second service with a 50 ms timeout, a two-second window, and 100 requests. Done means the circuit-breaking behavior is observable instead of all requests reaching the backend.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, spring
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.