Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
60b653bf
Commit
60b653bf
authored
9 years ago
by
yang-g
Browse files
Options
Downloads
Patches
Plain Diff
Use MONOTONIC instead of REALTIME
parent
88b77c64
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/client_config/subchannel.c
+4
-3
4 additions, 3 deletions
src/core/client_config/subchannel.c
with
4 additions
and
3 deletions
src/core/client_config/subchannel.c
+
4
−
3
View file @
60b653bf
...
@@ -273,7 +273,7 @@ void grpc_subchannel_del_interested_party(grpc_subchannel *c,
...
@@ -273,7 +273,7 @@ void grpc_subchannel_del_interested_party(grpc_subchannel *c,
}
}
static
gpr_int32
random_seed
()
{
static
gpr_int32
random_seed
()
{
return
gpr_time_to_millis
(
gpr_now
(
GPR_CLOCK_
REALTIME
));
return
gpr_time_to_millis
(
gpr_now
(
GPR_CLOCK_
MONOTONIC
));
}
}
grpc_subchannel
*
grpc_subchannel_create
(
grpc_connector
*
connector
,
grpc_subchannel
*
grpc_subchannel_create
(
grpc_connector
*
connector
,
...
@@ -608,7 +608,8 @@ static void update_reconnect_parameters(grpc_subchannel *c) {
...
@@ -608,7 +608,8 @@ static void update_reconnect_parameters(grpc_subchannel *c) {
backoff_delta_millis
=
max_backoff_millis
;
backoff_delta_millis
=
max_backoff_millis
;
}
}
c
->
backoff_delta
=
gpr_time_from_millis
(
backoff_delta_millis
,
GPR_TIMESPAN
);
c
->
backoff_delta
=
gpr_time_from_millis
(
backoff_delta_millis
,
GPR_TIMESPAN
);
c
->
next_attempt
=
gpr_time_add
(
gpr_now
(
GPR_CLOCK_REALTIME
),
c
->
backoff_delta
);
c
->
next_attempt
=
gpr_time_add
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
c
->
backoff_delta
);
jitter_range
=
GRPC_SUBCHANNEL_RECONNECT_JITTER
*
backoff_delta_millis
;
jitter_range
=
GRPC_SUBCHANNEL_RECONNECT_JITTER
*
backoff_delta_millis
;
jitter
=
jitter
=
...
@@ -654,7 +655,7 @@ static gpr_timespec compute_connect_deadline(grpc_subchannel *c) {
...
@@ -654,7 +655,7 @@ static gpr_timespec compute_connect_deadline(grpc_subchannel *c) {
gpr_timespec
current_deadline
=
gpr_timespec
current_deadline
=
gpr_time_add
(
c
->
next_attempt
,
c
->
backoff_delta
);
gpr_time_add
(
c
->
next_attempt
,
c
->
backoff_delta
);
gpr_timespec
min_deadline
=
gpr_time_add
(
gpr_timespec
min_deadline
=
gpr_time_add
(
gpr_now
(
GPR_CLOCK_
REALTIME
),
gpr_now
(
GPR_CLOCK_
MONOTONIC
),
gpr_time_from_seconds
(
GRPC_SUBCHANNEL_MIN_CONNECT_TIMEOUT_SECONDS
,
gpr_time_from_seconds
(
GRPC_SUBCHANNEL_MIN_CONNECT_TIMEOUT_SECONDS
,
GPR_TIMESPAN
));
GPR_TIMESPAN
));
return
gpr_time_cmp
(
current_deadline
,
min_deadline
)
>
0
?
current_deadline
return
gpr_time_cmp
(
current_deadline
,
min_deadline
)
>
0
?
current_deadline
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment