Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
2dec1be9
Commit
2dec1be9
authored
Sep 11, 2018
by
TousakaRin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug: Isolation cannot be triggered when ema_latency is 0
parent
61096437
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
circuit_breaker.cpp
src/brpc/circuit_breaker.cpp
+3
-0
No files found.
src/brpc/circuit_breaker.cpp
View file @
2dec1be9
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <cmath>
#include <cmath>
#include <gflags/gflags.h>
#include <gflags/gflags.h>
#include <butil/time.h>
#include <butil/time.h>
#include <butil/logging.h>
#include "brpc/circuit_breaker.h"
#include "brpc/circuit_breaker.h"
namespace
brpc
{
namespace
brpc
{
...
@@ -116,7 +117,9 @@ int64_t CircuitBreaker::EmaErrorRecorder::UpdateLatency(int64_t latency) {
...
@@ -116,7 +117,9 @@ int64_t CircuitBreaker::EmaErrorRecorder::UpdateLatency(int64_t latency) {
bool
CircuitBreaker
::
EmaErrorRecorder
::
UpdateErrorCost
(
int64_t
error_cost
,
bool
CircuitBreaker
::
EmaErrorRecorder
::
UpdateErrorCost
(
int64_t
error_cost
,
int64_t
ema_latency
)
{
int64_t
ema_latency
)
{
const
int
max_mutilple
=
FLAGS_circuit_breaker_max_failed_latency_mutilple
;
const
int
max_mutilple
=
FLAGS_circuit_breaker_max_failed_latency_mutilple
;
if
(
ema_latency
!=
0
)
{
error_cost
=
std
::
min
(
ema_latency
*
max_mutilple
,
error_cost
);
error_cost
=
std
::
min
(
ema_latency
*
max_mutilple
,
error_cost
);
}
//Errorous response
//Errorous response
if
(
error_cost
!=
0
)
{
if
(
error_cost
!=
0
)
{
int64_t
ema_error_cost
=
int64_t
ema_error_cost
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment