Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support half-open state for circuit breaking in Sentinel #154

Closed
thefenghou opened this issue Sep 21, 2018 · 1 comment · Fixed by #1490
Closed

Support half-open state for circuit breaking in Sentinel #154

thefenghou opened this issue Sep 21, 2018 · 1 comment · Fixed by #1490
Labels
area/circuit-breaking Issues or PRs related to circuit breaking kind/feature Category issues or prs related to feature request.
Milestone

Comments

@thefenghou
Copy link

thefenghou commented Sep 21, 2018

##Sentinel以后会增加熔断半打开状态吗?

Type: feature request

你好,发现目前的DegradeRule中不存在熔断的半打开状态,也就是当熔断窗口时间(timeWindow)到达以后,熔断会关闭,这时如果被调用服务还未恢复,有可能会造成大量请求失败或阻塞。而Hystrix中的熔断有一个半打开状态,只允许个别请求通过,确认被调用服务恢复后才关闭熔断。Sentinel以后有考虑增加这方面功能的改进吗?

        synchronized (lock) {
            if (!cut) {
                // Automatically degrade.
                cut = true;
                ResetTask resetTask = new ResetTask(this);
                pool.schedule(resetTask, timeWindow, TimeUnit.SECONDS);
            }

            return false;
        }

......

    private static final class ResetTask implements Runnable {

        private DegradeRule rule;

        ResetTask(DegradeRule rule) {
            this.rule = rule;
        }

        @Override
        public void run() {
            rule.getPassCount().set(0);
            rule.setCut(false);
        }
    }
@sczyh30 sczyh30 added the kind/question Category issues related to questions or problems label Sep 26, 2018
@CalvinKirs
Copy link

另外还存在一些bug,异常数判断这里如果在同一个时间窗口,那么熔断关闭后无论如何都会再次进入熔断开启状态。判断这里有问题。不在同一个时间窗口则万事大吉

@sczyh30 sczyh30 changed the title 熔断机制是否会支持半打开状态 Support half-open state for circuit breaking in Sentinel Mar 4, 2019
@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. and removed kind/question Category issues related to questions or problems labels Mar 4, 2019
@sczyh30 sczyh30 added the area/circuit-breaking Issues or PRs related to circuit breaking label Jul 4, 2019
@sczyh30 sczyh30 added kind/feature Category issues or prs related to feature request. and removed kind/enhancement Category issues or prs related to enhancement. labels Apr 16, 2020
@sczyh30 sczyh30 added this to the 1.8.0 milestone Apr 16, 2020
CST11021 pushed a commit to CST11021/Sentinel that referenced this issue Nov 3, 2021
Author: willim.z <zwillim@gmail.com>

Closes alibaba#154 from zwillim/patch-1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/circuit-breaking Issues or PRs related to circuit breaking kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants