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
aaa779e5
Commit
aaa779e5
authored
7 years ago
by
Yuchen Zeng
Browse files
Options
Downloads
Patches
Plain Diff
Add GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED
parent
6cb260af
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/core/ext/transport/chttp2/transport/chttp2_transport.c
+12
-11
12 additions, 11 deletions
src/core/ext/transport/chttp2/transport/chttp2_transport.c
src/core/ext/transport/chttp2/transport/internal.h
+1
-0
1 addition, 0 deletions
src/core/ext/transport/chttp2/transport/internal.h
with
13 additions
and
11 deletions
src/core/ext/transport/chttp2/transport/chttp2_transport.c
+
12
−
11
View file @
aaa779e5
...
@@ -544,9 +544,9 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
...
@@ -544,9 +544,9 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t,
gpr_time_add
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
t
->
keepalive_time
),
gpr_time_add
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
t
->
keepalive_time
),
&
t
->
init_keepalive_ping_locked
,
gpr_now
(
GPR_CLOCK_MONOTONIC
));
&
t
->
init_keepalive_ping_locked
,
gpr_now
(
GPR_CLOCK_MONOTONIC
));
}
else
{
}
else
{
/* Use GRPC_CHTTP2_KEEPALIVE_STATE_D
YING
to indicate there are no
inflight
/* Use GRPC_CHTTP2_KEEPALIVE_STATE_D
ISABLED
to indicate there are no
keeaplive timers */
inflight
keeaplive timers */
t
->
keepalive_state
=
GRPC_CHTTP2_KEEPALIVE_STATE_D
YING
;
t
->
keepalive_state
=
GRPC_CHTTP2_KEEPALIVE_STATE_D
ISABLED
;
}
}
grpc_chttp2_initiate_write
(
exec_ctx
,
t
,
false
,
"init"
);
grpc_chttp2_initiate_write
(
exec_ctx
,
t
,
false
,
"init"
);
...
@@ -596,18 +596,17 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx,
...
@@ -596,18 +596,17 @@ static void close_transport_locked(grpc_exec_ctx *exec_ctx,
GRPC_ERROR_REF
(
error
),
"close_transport"
);
GRPC_ERROR_REF
(
error
),
"close_transport"
);
grpc_endpoint_shutdown
(
exec_ctx
,
t
->
ep
,
GRPC_ERROR_REF
(
error
));
grpc_endpoint_shutdown
(
exec_ctx
,
t
->
ep
,
GRPC_ERROR_REF
(
error
));
switch
(
t
->
keepalive_state
)
{
switch
(
t
->
keepalive_state
)
{
case
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
:
{
case
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
:
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_ping_timer
);
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_ping_timer
);
break
;
break
;
}
case
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
:
case
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
:
{
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_ping_timer
);
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_ping_timer
);
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_watchdog_timer
);
grpc_timer_cancel
(
exec_ctx
,
&
t
->
keepalive_watchdog_timer
);
break
;
break
;
}
case
GRPC_CHTTP2_KEEPALIVE_STATE_DYING
:
case
GRPC_CHTTP2_KEEPALIVE_STATE_DYING
:
{
case
GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED
:
/* keepalive timers are not set in these two states */
break
;
break
;
}
}
}
/* flush writable stream list to avoid dangling references */
/* flush writable stream list to avoid dangling references */
...
@@ -2269,7 +2268,9 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
...
@@ -2269,7 +2268,9 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error
*
error
)
{
grpc_error
*
error
)
{
grpc_chttp2_transport
*
t
=
arg
;
grpc_chttp2_transport
*
t
=
arg
;
GPR_ASSERT
(
t
->
keepalive_state
==
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
);
GPR_ASSERT
(
t
->
keepalive_state
==
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
);
if
(
error
==
GRPC_ERROR_NONE
&&
!
(
t
->
destroying
||
t
->
closed
))
{
if
(
t
->
destroying
||
t
->
closed
)
{
t
->
keepalive_state
=
GRPC_CHTTP2_KEEPALIVE_STATE_DYING
;
}
else
if
(
error
==
GRPC_ERROR_NONE
)
{
if
(
t
->
keepalive_permit_without_calls
||
if
(
t
->
keepalive_permit_without_calls
||
grpc_chttp2_stream_map_size
(
&
t
->
stream_map
)
>
0
)
{
grpc_chttp2_stream_map_size
(
&
t
->
stream_map
)
>
0
)
{
t
->
keepalive_state
=
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
;
t
->
keepalive_state
=
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
;
...
@@ -2284,7 +2285,7 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
...
@@ -2284,7 +2285,7 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg,
gpr_time_add
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
t
->
keepalive_time
),
gpr_time_add
(
gpr_now
(
GPR_CLOCK_MONOTONIC
),
t
->
keepalive_time
),
&
t
->
init_keepalive_ping_locked
,
gpr_now
(
GPR_CLOCK_MONOTONIC
));
&
t
->
init_keepalive_ping_locked
,
gpr_now
(
GPR_CLOCK_MONOTONIC
));
}
}
}
else
if
(
error
==
GRPC_ERROR_CANCELLED
&&
!
(
t
->
destroying
||
t
->
closed
)
)
{
}
else
if
(
error
==
GRPC_ERROR_CANCELLED
)
{
/* The keepalive ping timer may be cancelled by bdp */
/* The keepalive ping timer may be cancelled by bdp */
GRPC_CHTTP2_REF_TRANSPORT
(
t
,
"init keepalive ping"
);
GRPC_CHTTP2_REF_TRANSPORT
(
t
,
"init keepalive ping"
);
grpc_timer_init
(
grpc_timer_init
(
...
...
This diff is collapsed.
Click to expand it.
src/core/ext/transport/chttp2/transport/internal.h
+
1
−
0
View file @
aaa779e5
...
@@ -222,6 +222,7 @@ typedef enum {
...
@@ -222,6 +222,7 @@ typedef enum {
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
,
GRPC_CHTTP2_KEEPALIVE_STATE_WAITING
,
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
,
GRPC_CHTTP2_KEEPALIVE_STATE_PINGING
,
GRPC_CHTTP2_KEEPALIVE_STATE_DYING
,
GRPC_CHTTP2_KEEPALIVE_STATE_DYING
,
GRPC_CHTTP2_KEEPALIVE_STATE_DISABLED
,
}
grpc_chttp2_keepalive_state
;
}
grpc_chttp2_keepalive_state
;
struct
grpc_chttp2_transport
{
struct
grpc_chttp2_transport
{
...
...
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