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
9c5318ab
Commit
9c5318ab
authored
8 years ago
by
Craig Tiller
Browse files
Options
Downloads
Patches
Plain Diff
Fix shutdown problems with sync server
parent
1d3ad2b2
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/lib/surface/call.c
+4
-0
4 additions, 0 deletions
src/core/lib/surface/call.c
src/cpp/server/server_cc.cc
+6
-6
6 additions, 6 deletions
src/cpp/server/server_cc.cc
with
10 additions
and
6 deletions
src/core/lib/surface/call.c
+
4
−
0
View file @
9c5318ab
...
@@ -1551,6 +1551,10 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
...
@@ -1551,6 +1551,10 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
error
=
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
;
error
=
GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
;
goto
done_with_error
;
goto
done_with_error
;
}
}
/* IF this is a server, then GRPC_OP_RECV_INITIAL_METADATA *must* come
from server.c. In that case, it's coming from accept_stream, and in
that case we're not necessarily covered by a poller. */
stream_op
->
covered_by_poller
=
call
->
is_client
;
call
->
received_initial_metadata
=
1
;
call
->
received_initial_metadata
=
1
;
call
->
buffered_metadata
[
0
]
=
op
->
data
.
recv_initial_metadata
;
call
->
buffered_metadata
[
0
]
=
op
->
data
.
recv_initial_metadata
;
grpc_closure_init
(
&
call
->
receiving_initial_metadata_ready
,
grpc_closure_init
(
&
call
->
receiving_initial_metadata_ready
,
...
...
This diff is collapsed.
Click to expand it.
src/cpp/server/server_cc.cc
+
6
−
6
View file @
9c5318ab
...
@@ -510,12 +510,6 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
...
@@ -510,12 +510,6 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
ShutdownTag
shutdown_tag
;
// Dummy shutdown tag
ShutdownTag
shutdown_tag
;
// Dummy shutdown tag
grpc_server_shutdown_and_notify
(
server_
,
shutdown_cq
.
cq
(),
&
shutdown_tag
);
grpc_server_shutdown_and_notify
(
server_
,
shutdown_cq
.
cq
(),
&
shutdown_tag
);
// Shutdown all ThreadManagers. This will try to gracefully stop all the
// threads in the ThreadManagers (once they process any inflight requests)
for
(
auto
it
=
sync_req_mgrs_
.
begin
();
it
!=
sync_req_mgrs_
.
end
();
it
++
)
{
(
*
it
)
->
Shutdown
();
// ThreadManager's Shutdown()
}
shutdown_cq
.
Shutdown
();
shutdown_cq
.
Shutdown
();
void
*
tag
;
void
*
tag
;
...
@@ -531,6 +525,12 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
...
@@ -531,6 +525,12 @@ void Server::ShutdownInternal(gpr_timespec deadline) {
// Else in case of SHUTDOWN or GOT_EVENT, it means that the server has
// Else in case of SHUTDOWN or GOT_EVENT, it means that the server has
// successfully shutdown
// successfully shutdown
// Shutdown all ThreadManagers. This will try to gracefully stop all the
// threads in the ThreadManagers (once they process any inflight requests)
for
(
auto
it
=
sync_req_mgrs_
.
begin
();
it
!=
sync_req_mgrs_
.
end
();
it
++
)
{
(
*
it
)
->
Shutdown
();
// ThreadManager's Shutdown()
}
// Wait for threads in all ThreadManagers to terminate
// Wait for threads in all ThreadManagers to terminate
for
(
auto
it
=
sync_req_mgrs_
.
begin
();
it
!=
sync_req_mgrs_
.
end
();
it
++
)
{
for
(
auto
it
=
sync_req_mgrs_
.
begin
();
it
!=
sync_req_mgrs_
.
end
();
it
++
)
{
(
*
it
)
->
Wait
();
(
*
it
)
->
Wait
();
...
...
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