Skip to content

Commit

Permalink
fix:修复熔断指标上报数据不对问题
Browse files Browse the repository at this point in the history
  • Loading branch information
springliao authored and SkyeBeFreeman committed Apr 25, 2023
1 parent 89894f7 commit de95730
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public interface ProviderAPI extends AutoCloseable, Closeable {

/**
* Register instance, minimum supported version of polaris-server is v1.10.0
* 注册服务实例,同时根据用户设置的 heartbeat ttl 维护心跳任务
*
* @param req register request
* @return service register response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class RegisterFlow {

public RegisterFlow(SDKContext sdkContext) {
this.sdkContext = sdkContext;
this.asyncRegisterExecutor = new ScheduledThreadPoolExecutor(1, new NamedThreadFactory("async-register"));
this.asyncRegisterExecutor = new ScheduledThreadPoolExecutor(4, new NamedThreadFactory("async-register"));
}

public InstanceRegisterResponse registerInstance(InstanceRegisterRequest request, RegisterFunction registerFunction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ private void toOpen(CircuitBreakerStatus preStatus, String circuitBreaker) {
circuitBreakerStatusReference.set(newStatus);
CB_EVENT_LOG.info("previous status {}, current status {}, resource {}, rule {}", preStatus.getStatus(),
newStatus.getStatus(), resource, circuitBreaker);
reportCircuitStatus();
int sleepWindow = currentActiveRule.getRecoverCondition().getSleepWindow();
// add callback after timeout
stateChangeExecutors.schedule(new Runnable() {
Expand Down Expand Up @@ -213,8 +214,8 @@ public void halfOpenToClose() {
for (TriggerCounter triggerCounter : counters) {
triggerCounter.resume();
}
reportCircuitStatus();
}
reportCircuitStatus();
}
}

Expand All @@ -225,7 +226,6 @@ public void halfOpenToOpen() {
if (circuitBreakerStatus.getStatus() == Status.HALF_OPEN) {
toOpen(circuitBreakerStatus, circuitBreakerStatus.getCircuitBreaker());
}
reportCircuitStatus();
}
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<properties>
<!-- Project revision -->
<revision>1.12.0</revision>
<revision>1.12.1</revision>

<timestamp>${maven.build.timestamp}</timestamp>
<skip.maven.deploy>false</skip.maven.deploy>
Expand Down

0 comments on commit de95730

Please sign in to comment.