Merge pull request #14351 from sreecha/bm-epollex-fix

Fix the server shutdown code in Fullstack_fixtures
pull/14224/merge
Sree Kuchibhotla 7 years ago committed by GitHub
commit 3261b2d575
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      test/cpp/microbenchmarks/fullstack_fixtures.h

@ -61,6 +61,15 @@ class FixtureConfiguration {
class BaseFixture : public TrackCounters {};
// Special tag to be used in Server shutdown. This tag is *NEVER* returned when
// Cq->Next() API is called (This is because FinalizeResult() function in this
// class always returns 'false'). This is intentional and makes writing shutdown
// code easier.
class ShutdownTag : public internal::CompletionQueueTag {
public:
bool FinalizeResult(void** tag, bool* status) { return false; }
};
class FullstackFixture : public BaseFixture {
public:
FullstackFixture(Service* service, const FixtureConfiguration& config,
@ -84,7 +93,11 @@ class FullstackFixture : public BaseFixture {
}
virtual ~FullstackFixture() {
server_->Shutdown(gpr_inf_past(GPR_CLOCK_MONOTONIC));
// Dummy shutdown tag (this tag is swallowed by cq->Next() and is not
// returned to the user) see ShutdownTag definition for more details
ShutdownTag shutdown_tag;
grpc_server_shutdown_and_notify(server_->c_server(), cq_->cq(),
&shutdown_tag);
cq_->Shutdown();
void* tag;
bool ok;
@ -208,7 +221,11 @@ class EndpointPairFixture : public BaseFixture {
}
virtual ~EndpointPairFixture() {
server_->Shutdown(gpr_inf_past(GPR_CLOCK_MONOTONIC));
// Dummy shutdown tag (this tag is swallowed by cq->Next() and is not
// returned to the user) see ShutdownTag definition for more details
ShutdownTag shutdown_tag;
grpc_server_shutdown_and_notify(server_->c_server(), cq_->cq(),
&shutdown_tag);
cq_->Shutdown();
void* tag;
bool ok;

Loading…
Cancel
Save