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
f782465f
Commit
f782465f
authored
8 years ago
by
Vijay Pai
Browse files
Options
Downloads
Patches
Plain Diff
Fix some shutdown errors related to CQ/join ordering
parent
aa8bbeb6
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
test/cpp/qps/client_async.cc
+30
-13
30 additions, 13 deletions
test/cpp/qps/client_async.cc
test/cpp/qps/qps_worker.cc
+2
-0
2 additions, 0 deletions
test/cpp/qps/qps_worker.cc
with
32 additions
and
13 deletions
test/cpp/qps/client_async.cc
+
30
−
13
View file @
f782465f
...
...
@@ -189,14 +189,7 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
}
}
virtual
~
AsyncClient
()
{
for
(
auto
cq
=
cli_cqs_
.
begin
();
cq
!=
cli_cqs_
.
end
();
cq
++
)
{
(
*
cq
)
->
Shutdown
();
void
*
got_tag
;
bool
ok
;
while
((
*
cq
)
->
Next
(
&
got_tag
,
&
ok
))
{
delete
ClientRpcContext
::
detag
(
got_tag
);
}
}
FinalShutdownCQs
();
}
bool
ThreadFunc
(
HistogramEntry
*
entry
,
...
...
@@ -216,14 +209,29 @@ class AsyncClient : public ClientImpl<StubType, RequestType> {
delete
ctx
;
}
return
true
;
}
else
{
// queue is shutting down
return
fals
e
;
}
else
{
// queue is shutting down
, so we must be done
return
tru
e
;
}
}
protected
:
const
int
num_async_threads_
;
void
ShutdownCQs
()
{
for
(
auto
cq
=
cli_cqs_
.
begin
();
cq
!=
cli_cqs_
.
end
();
cq
++
)
{
(
*
cq
)
->
Shutdown
();
}
}
void
FinalShutdownCQs
()
{
for
(
auto
cq
=
cli_cqs_
.
begin
();
cq
!=
cli_cqs_
.
end
();
cq
++
)
{
void
*
got_tag
;
bool
ok
;
while
((
*
cq
)
->
Next
(
&
got_tag
,
&
ok
))
{
delete
ClientRpcContext
::
detag
(
got_tag
);
}
}
}
private
:
int
NumThreads
(
const
ClientConfig
&
config
)
{
int
num_threads
=
config
.
async_client_threads
();
...
...
@@ -251,7 +259,10 @@ class AsyncUnaryClient GRPC_FINAL
config
,
SetupCtx
,
BenchmarkStubCreator
)
{
StartThreads
(
num_async_threads_
);
}
~
AsyncUnaryClient
()
GRPC_OVERRIDE
{
EndThreads
();
}
~
AsyncUnaryClient
()
GRPC_OVERRIDE
{
ShutdownCQs
();
EndThreads
();
}
private
:
static
void
CheckDone
(
grpc
::
Status
s
,
SimpleResponse
*
response
)
{}
...
...
@@ -380,7 +391,10 @@ class AsyncStreamingClient GRPC_FINAL
StartThreads
(
num_async_threads_
);
}
~
AsyncStreamingClient
()
GRPC_OVERRIDE
{
EndThreads
();
}
~
AsyncStreamingClient
()
GRPC_OVERRIDE
{
ShutdownCQs
();
EndThreads
();
}
private
:
static
void
CheckDone
(
grpc
::
Status
s
,
SimpleResponse
*
response
)
{}
...
...
@@ -516,7 +530,10 @@ class GenericAsyncStreamingClient GRPC_FINAL
StartThreads
(
num_async_threads_
);
}
~
GenericAsyncStreamingClient
()
GRPC_OVERRIDE
{
EndThreads
();
}
~
GenericAsyncStreamingClient
()
GRPC_OVERRIDE
{
ShutdownCQs
();
EndThreads
();
}
private
:
static
void
CheckDone
(
grpc
::
Status
s
,
ByteBuffer
*
response
)
{}
...
...
This diff is collapsed.
Click to expand it.
test/cpp/qps/qps_worker.cc
+
2
−
0
View file @
f782465f
...
...
@@ -128,6 +128,7 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
ScopedProfile
profile
(
"qps_client.prof"
,
false
);
Status
ret
=
RunClientBody
(
ctx
,
stream
);
gpr_log
(
GPR_INFO
,
"RunClient: Returning"
);
return
ret
;
}
...
...
@@ -141,6 +142,7 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
ScopedProfile
profile
(
"qps_server.prof"
,
false
);
Status
ret
=
RunServerBody
(
ctx
,
stream
);
gpr_log
(
GPR_INFO
,
"RunServer: Returning"
);
return
ret
;
}
...
...
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