More import fixes

pull/11160/head
Craig Tiller 8 years ago
parent a753371f05
commit 840931eec9
  1. 5
      include/grpc++/impl/codegen/status.h
  2. 9
      src/core/lib/iomgr/timer_manager.c
  3. 1
      test/cpp/end2end/BUILD
  4. 14
      test/cpp/interop/BUILD
  5. 3
      test/cpp/qps/BUILD
  6. 2
      test/cpp/qps/client_sync.cc

@ -75,6 +75,11 @@ class Status {
/// Is the status OK? /// Is the status OK?
bool ok() const { return code_ == StatusCode::OK; } bool ok() const { return code_ == StatusCode::OK; }
// Ignores any errors. This method does nothing except potentially suppress
// complaints from any tools that are checking that errors are not dropped on
// the floor.
void IgnoreError() const {}
private: private:
StatusCode code_; StatusCode code_;
grpc::string error_message_; grpc::string error_message_;

@ -93,10 +93,10 @@ static void start_timer_thread_and_unlock(void) {
if (GRPC_TRACER_ON(grpc_timer_check_trace)) { if (GRPC_TRACER_ON(grpc_timer_check_trace)) {
gpr_log(GPR_DEBUG, "Spawn timer thread"); gpr_log(GPR_DEBUG, "Spawn timer thread");
} }
gpr_thd_id thd;
gpr_thd_options opt = gpr_thd_options_default(); gpr_thd_options opt = gpr_thd_options_default();
gpr_thd_options_set_joinable(&opt); gpr_thd_options_set_joinable(&opt);
gpr_thd_new(&thd, timer_thread, NULL, &opt); completed_thread *ct = gpr_malloc(sizeof(*ct));
gpr_thd_new(&ct->t, timer_thread, ct, &opt);
} }
void grpc_timer_manager_tick() { void grpc_timer_manager_tick() {
@ -107,7 +107,7 @@ void grpc_timer_manager_tick() {
grpc_exec_ctx_finish(&exec_ctx); grpc_exec_ctx_finish(&exec_ctx);
} }
static void timer_thread(void *unused) { static void timer_thread(void *completed_thread_ptr) {
// this threads exec_ctx: we try to run things through to completion here // this threads exec_ctx: we try to run things through to completion here
// since it's easy to spin up new threads // since it's easy to spin up new threads
grpc_exec_ctx exec_ctx = grpc_exec_ctx exec_ctx =
@ -194,8 +194,7 @@ static void timer_thread(void *unused) {
if (0 == g_thread_count) { if (0 == g_thread_count) {
gpr_cv_signal(&g_cv_shutdown); gpr_cv_signal(&g_cv_shutdown);
} }
completed_thread *ct = gpr_malloc(sizeof(*ct)); completed_thread *ct = completed_thread_ptr;
ct->t = gpr_thd_currentid();
ct->next = g_completed_threads; ct->next = g_completed_threads;
g_completed_threads = ct; g_completed_threads = ct;
gpr_mu_unlock(&g_mu); gpr_mu_unlock(&g_mu);

@ -35,6 +35,7 @@ package(default_visibility=["//visibility:public"]) # Allows external users to i
grpc_cc_library( grpc_cc_library(
name = "test_service_impl", name = "test_service_impl",
testonly = True,
srcs = ["test_service_impl.cc"], srcs = ["test_service_impl.cc"],
hdrs = ["test_service_impl.h"], hdrs = ["test_service_impl.h"],
deps = [ deps = [

@ -86,13 +86,21 @@ grpc_cc_library(
], ],
) )
grpc_cc_binary( grpc_cc_library(
name = "interop_client", name = "interop_client_main",
language = "c++", language = "c++",
srcs = [ srcs = [
"client.cc", "client.cc",
], ],
deps = [ deps = [
":client_helper_lib", ":client_helper_lib"
],
)
grpc_cc_binary(
name = "interop_client",
language = "c++",
deps = [
":interop_client_main",
], ],
) )

@ -67,9 +67,6 @@ grpc_cc_library(
"//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util",
"//test/cpp/util:test_util", "//test/cpp/util:test_util",
], ],
external_deps = [
"gtest",
],
) )
grpc_cc_library( grpc_cc_library(

@ -155,7 +155,7 @@ class SynchronousStreamingClient : public SynchronousClient {
if (*stream) { if (*stream) {
// forcibly cancel the streams, then finish // forcibly cancel the streams, then finish
context_[i].TryCancel(); context_[i].TryCancel();
(*stream)->Finish(); (*stream)->Finish().IgnoreError();
// don't log any error message on !ok since this was canceled // don't log any error message on !ok since this was canceled
} }
}); });

Loading…
Cancel
Save