diff options
author | Craig Tiller <ctiller@google.com> | 2017-05-10 13:36:20 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-05-10 13:36:20 -0700 |
commit | a7785ba22ee670121a77cbae06600ef02b3ad15f (patch) | |
tree | 4580f0f2b087f906ee3240e4c52b1dcabaf6a738 | |
parent | 6e18ef3880da523af4c131d34234aa1c4e4221c0 (diff) | |
parent | 9341519b83a606bc9ab247f8561af18a0d47286c (diff) |
Merge github.com:grpc/grpc into uberpoll
-rw-r--r-- | setup.py | 2 | ||||
-rwxr-xr-x | src/boringssl/gen_build_yaml.py | 2 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.c | 2 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/parsing.c | 5 | ||||
-rw-r--r-- | src/python/grpcio/commands.py | 4 | ||||
-rw-r--r-- | test/core/end2end/cq_verifier.c | 4 | ||||
-rw-r--r-- | test/core/end2end/fake_resolver.c | 15 | ||||
-rw-r--r-- | test/core/end2end/fixtures/http_proxy_fixture.c | 27 | ||||
-rw-r--r-- | test/core/security/oauth2_utils.c | 6 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/bm_call_create.cc | 3 | ||||
-rw-r--r-- | test/cpp/microbenchmarks/bm_fullstack_trickle.cc | 125 | ||||
-rw-r--r-- | test/cpp/performance/writes_per_rpc_test.cc | 4 | ||||
-rw-r--r-- | tools/run_tests/generated/tests.json | 195 | ||||
-rw-r--r-- | tools/ubsan_suppressions.txt | 2 |
14 files changed, 286 insertions, 110 deletions
@@ -116,7 +116,7 @@ if EXTRA_ENV_COMPILE_ARGS is None: elif 'win32' in sys.platform: EXTRA_ENV_COMPILE_ARGS += ' -D_PYTHON_MSVC' elif "linux" in sys.platform: - EXTRA_ENV_COMPILE_ARGS += ' -std=c++11 -fvisibility=hidden -fno-wrapv' + EXTRA_ENV_COMPILE_ARGS += ' -std=c++11 -std=gnu99 -fvisibility=hidden -fno-wrapv' elif "darwin" in sys.platform: EXTRA_ENV_COMPILE_ARGS += ' -fvisibility=hidden -fno-wrapv' diff --git a/src/boringssl/gen_build_yaml.py b/src/boringssl/gen_build_yaml.py index c53beb0da5..d01c2b4ec5 100755 --- a/src/boringssl/gen_build_yaml.py +++ b/src/boringssl/gen_build_yaml.py @@ -138,7 +138,7 @@ class Grpc(object): { 'name': 'boringssl_%s' % os.path.basename(test[0]), 'args': [map_testarg(arg) for arg in test[1:]], - 'exclude_configs': ['asan'], + 'exclude_configs': ['asan', 'ubsan'], 'ci_platforms': ['linux', 'mac', 'posix', 'windows'], 'platforms': ['linux', 'mac', 'posix', 'windows'], 'flaky': False, diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 6930cc99d1..0ff1e0b745 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -2554,7 +2554,7 @@ static void incoming_byte_stream_update_flow_control(grpc_exec_ctx *exec_ctx, add_max_recv_bytes); if ((int64_t)s->incoming_window_delta + (int64_t)initial_window_size - (int64_t)s->announce_window > - 2 * (int64_t)initial_window_size) { + (int64_t)initial_window_size / 2) { write_type = GRPC_CHTTP2_STREAM_WRITE_PIGGYBACK; } grpc_chttp2_become_writable(exec_ctx, t, s, write_type, diff --git a/src/core/ext/transport/chttp2/transport/parsing.c b/src/core/ext/transport/chttp2/transport/parsing.c index d49b26e131..1a676e2259 100644 --- a/src/core/ext/transport/chttp2/transport/parsing.c +++ b/src/core/ext/transport/chttp2/transport/parsing.c @@ -418,7 +418,10 @@ static grpc_error *update_incoming_window(grpc_exec_ctx *exec_ctx, GRPC_CHTTP2_FLOW_DEBIT_STREAM_INCOMING_WINDOW_DELTA("parse", t, s, incoming_frame_size); - if ((int64_t)s->incoming_window_delta - (int64_t)s->announce_window <= 0) { + if ((int64_t)s->incoming_window_delta - (int64_t)s->announce_window <= + -(int64_t)t->settings[GRPC_SENT_SETTINGS] + [GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE] / + 2) { grpc_chttp2_become_writable(exec_ctx, t, s, GRPC_CHTTP2_STREAM_WRITE_INITIATE_UNCOVERED, "window-update-required"); diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 4f072809c4..f4ccb1ab94 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -284,9 +284,9 @@ class BuildExt(build_ext.build_ext): stderr=subprocess.PIPE) make_out, make_err = make_process.communicate() if make_out and make_process.returncode != 0: - sys.stdout.write(make_out + '\n') + sys.stdout.write(str(make_out) + '\n') if make_err: - sys.stderr.write(make_err + '\n') + sys.stderr.write(str(make_err) + '\n') if make_process.returncode != 0: raise Exception("make command failed!") diff --git a/test/core/end2end/cq_verifier.c b/test/core/end2end/cq_verifier.c index 5eea5d43fe..0fafb0c8c9 100644 --- a/test/core/end2end/cq_verifier.c +++ b/test/core/end2end/cq_verifier.c @@ -77,7 +77,7 @@ struct cq_verifier { }; cq_verifier *cq_verifier_create(grpc_completion_queue *cq) { - cq_verifier *v = gpr_malloc(sizeof(cq_verifier)); + cq_verifier *v = (cq_verifier *)gpr_malloc(sizeof(cq_verifier)); v->cq = cq; v->first_expectation = NULL; return v; @@ -314,7 +314,7 @@ void cq_verify_empty(cq_verifier *v) { cq_verify_empty_timeout(v, 1); } static void add(cq_verifier *v, const char *file, int line, grpc_completion_type type, void *tag, bool success) { - expectation *e = gpr_malloc(sizeof(expectation)); + expectation *e = (expectation *)gpr_malloc(sizeof(expectation)); e->type = type; e->file = file; e->line = line; diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c index df902a24bf..736b224fd6 100644 --- a/test/core/end2end/fake_resolver.c +++ b/test/core/end2end/fake_resolver.c @@ -136,7 +136,7 @@ struct grpc_fake_resolver_response_generator { grpc_fake_resolver_response_generator* grpc_fake_resolver_response_generator_create() { grpc_fake_resolver_response_generator* generator = - gpr_zalloc(sizeof(*generator)); + (grpc_fake_resolver_response_generator*)gpr_zalloc(sizeof(*generator)); gpr_ref_init(&generator->refcount, 1); return generator; } @@ -157,7 +157,8 @@ void grpc_fake_resolver_response_generator_unref( static void set_response_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - grpc_fake_resolver_response_generator* generator = arg; + grpc_fake_resolver_response_generator* generator = + (grpc_fake_resolver_response_generator*)arg; fake_resolver* r = generator->resolver; if (r->next_results != NULL) { grpc_channel_args_destroy(exec_ctx, r->next_results); @@ -180,11 +181,13 @@ void grpc_fake_resolver_response_generator_set_response( } static void* response_generator_arg_copy(void* p) { - return grpc_fake_resolver_response_generator_ref(p); + return grpc_fake_resolver_response_generator_ref( + (grpc_fake_resolver_response_generator*)p); } static void response_generator_arg_destroy(grpc_exec_ctx* exec_ctx, void* p) { - grpc_fake_resolver_response_generator_unref(p); + grpc_fake_resolver_response_generator_unref( + (grpc_fake_resolver_response_generator*)p); } static int response_generator_cmp(void* a, void* b) { return GPR_ICMP(a, b); } @@ -208,7 +211,7 @@ grpc_fake_resolver_get_response_generator(const grpc_channel_args* args) { const grpc_arg* arg = grpc_channel_args_find(args, GRPC_ARG_FAKE_RESOLVER_RESPONSE_GENERATOR); if (arg == NULL || arg->type != GRPC_ARG_POINTER) return NULL; - return arg->value.pointer.p; + return (grpc_fake_resolver_response_generator*)arg->value.pointer.p; } // @@ -222,7 +225,7 @@ static void fake_resolver_factory_unref(grpc_resolver_factory* factory) {} static grpc_resolver* fake_resolver_create(grpc_exec_ctx* exec_ctx, grpc_resolver_factory* factory, grpc_resolver_args* args) { - fake_resolver* r = gpr_zalloc(sizeof(*r)); + fake_resolver* r = (fake_resolver*)gpr_zalloc(sizeof(*r)); r->channel_args = grpc_channel_args_copy(args->args); grpc_resolver_init(&r->base, &fake_resolver_vtable, args->combiner); grpc_fake_resolver_response_generator* response_generator = diff --git a/test/core/end2end/fixtures/http_proxy_fixture.c b/test/core/end2end/fixtures/http_proxy_fixture.c index 4170a59eaf..c2d8480e69 100644 --- a/test/core/end2end/fixtures/http_proxy_fixture.c +++ b/test/core/end2end/fixtures/http_proxy_fixture.c @@ -156,7 +156,7 @@ static void proxy_connection_failed(grpc_exec_ctx* exec_ctx, // Callback for writing proxy data to the client. static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, true /* is_client */, "HTTP proxy client write", error); @@ -181,7 +181,7 @@ static void on_client_write_done(grpc_exec_ctx* exec_ctx, void* arg, // Callback for writing proxy data to the backend server. static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, false /* is_client */, "HTTP proxy server write", error); @@ -207,7 +207,7 @@ static void on_server_write_done(grpc_exec_ctx* exec_ctx, void* arg, // the backend server. static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, true /* is_client */, "HTTP proxy client read", error); @@ -239,7 +239,7 @@ static void on_client_read_done(grpc_exec_ctx* exec_ctx, void* arg, // proxied to the client. static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, false /* is_client */, "HTTP proxy server read", error); @@ -270,7 +270,7 @@ static void on_server_read_done(grpc_exec_ctx* exec_ctx, void* arg, // Callback to write the HTTP response for the CONNECT request. static void on_write_response_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { proxy_connection_failed(exec_ctx, conn, true /* is_client */, "HTTP proxy write response", error); @@ -294,7 +294,7 @@ static void on_write_response_done(grpc_exec_ctx* exec_ctx, void* arg, // CONNECT request. static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; if (error != GRPC_ERROR_NONE) { // TODO(roth): Technically, in this case, we should handle the error // by returning an HTTP response to the client indicating that the @@ -324,7 +324,7 @@ static void on_server_connect_done(grpc_exec_ctx* exec_ctx, void* arg, // which will cause the client connection to be dropped. static void on_read_request_done(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - proxy_connection* conn = arg; + proxy_connection* conn = (proxy_connection*)arg; gpr_log(GPR_DEBUG, "on_read_request_done: %p %s", conn, grpc_error_string(error)); if (error != GRPC_ERROR_NONE) { @@ -389,9 +389,9 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, grpc_endpoint* endpoint, grpc_pollset* accepting_pollset, grpc_tcp_server_acceptor* acceptor) { gpr_free(acceptor); - grpc_end2end_http_proxy* proxy = arg; + grpc_end2end_http_proxy* proxy = (grpc_end2end_http_proxy*)arg; // Instantiate proxy_connection. - proxy_connection* conn = gpr_zalloc(sizeof(*conn)); + proxy_connection* conn = (proxy_connection*)gpr_zalloc(sizeof(*conn)); gpr_ref(&proxy->users); conn->client_endpoint = endpoint; conn->proxy = proxy; @@ -430,7 +430,7 @@ static void on_accept(grpc_exec_ctx* exec_ctx, void* arg, // static void thread_main(void* arg) { - grpc_end2end_http_proxy* proxy = arg; + grpc_end2end_http_proxy* proxy = (grpc_end2end_http_proxy*)arg; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; do { gpr_ref(&proxy->users); @@ -450,7 +450,8 @@ static void thread_main(void* arg) { grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - grpc_end2end_http_proxy* proxy = gpr_malloc(sizeof(*proxy)); + grpc_end2end_http_proxy* proxy = + (grpc_end2end_http_proxy*)gpr_malloc(sizeof(*proxy)); memset(proxy, 0, sizeof(*proxy)); gpr_ref_init(&proxy->users, 1); // Construct proxy address. @@ -473,7 +474,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) { GPR_ASSERT(error == GRPC_ERROR_NONE); GPR_ASSERT(port == proxy_port); // Start server. - proxy->pollset = gpr_zalloc(grpc_pollset_size()); + proxy->pollset = (grpc_pollset*)gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(proxy->pollset, &proxy->mu); grpc_tcp_server_start(&exec_ctx, proxy->server, &proxy->pollset, 1, on_accept, proxy); @@ -487,7 +488,7 @@ grpc_end2end_http_proxy* grpc_end2end_http_proxy_create(void) { static void destroy_pollset(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) { - grpc_pollset* pollset = arg; + grpc_pollset* pollset = (grpc_pollset*)arg; grpc_pollset_destroy(exec_ctx, pollset); gpr_free(pollset); } diff --git a/test/core/security/oauth2_utils.c b/test/core/security/oauth2_utils.c index f0550db1d0..838625705d 100644 --- a/test/core/security/oauth2_utils.c +++ b/test/core/security/oauth2_utils.c @@ -55,7 +55,7 @@ static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *user_data, grpc_credentials_md *md_elems, size_t num_md, grpc_credentials_status status, const char *error_details) { - oauth2_request *request = user_data; + oauth2_request *request = (oauth2_request *)user_data; char *token = NULL; grpc_slice token_slice; if (status == GRPC_CREDENTIALS_ERROR) { @@ -63,7 +63,7 @@ static void on_oauth2_response(grpc_exec_ctx *exec_ctx, void *user_data, } else { GPR_ASSERT(num_md == 1); token_slice = md_elems[0].value; - token = gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1); + token = (char *)gpr_malloc(GRPC_SLICE_LENGTH(token_slice) + 1); memcpy(token, GRPC_SLICE_START_PTR(token_slice), GRPC_SLICE_LENGTH(token_slice)); token[GRPC_SLICE_LENGTH(token_slice)] = '\0'; @@ -87,7 +87,7 @@ char *grpc_test_fetch_oauth2_token_with_credentials( grpc_closure do_nothing_closure; grpc_auth_metadata_context null_ctx = {"", "", NULL, NULL}; - grpc_pollset *pollset = gpr_zalloc(grpc_pollset_size()); + grpc_pollset *pollset = (grpc_pollset *)gpr_zalloc(grpc_pollset_size()); grpc_pollset_init(pollset, &request.mu); request.pops = grpc_polling_entity_create_from_pollset(pollset); request.is_done = 0; diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc index c91219e98c..67e7c02535 100644 --- a/test/cpp/microbenchmarks/bm_call_create.cc +++ b/test/cpp/microbenchmarks/bm_call_create.cc @@ -563,7 +563,8 @@ static void BM_IsolatedFilter(benchmark::State &state) { } grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - size_t channel_size = grpc_channel_stack_size(&filters[0], filters.size()); + size_t channel_size = grpc_channel_stack_size( + filters.size() == 0 ? NULL : &filters[0], filters.size()); grpc_channel_stack *channel_stack = static_cast<grpc_channel_stack *>(gpr_zalloc(channel_size)); GPR_ASSERT(GRPC_LOG_IF_ERROR( diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc index fc99b06dbb..6b9fa8b38d 100644 --- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc +++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc @@ -53,7 +53,7 @@ DEFINE_int32( "Number of megabytes to pump before collecting flow control stats"); DEFINE_int32( warmup_iterations, 100, - "Number of megabytes to pump before collecting flow control stats"); + "Number of iterations to run before collecting flow control stats"); DEFINE_int32(warmup_max_time_seconds, 10, "Maximum number of seconds to run warmup loop"); @@ -77,13 +77,14 @@ static void write_csv(std::ostream* out, A0&& a0, Arg&&... arg) { class TrickledCHTTP2 : public EndpointPairFixture { public: - TrickledCHTTP2(Service* service, size_t message_size, - size_t kilobits_per_second) + TrickledCHTTP2(Service* service, bool streaming, size_t req_size, + size_t resp_size, size_t kilobits_per_second) : EndpointPairFixture(service, MakeEndpoints(kilobits_per_second), FixtureConfiguration()) { if (FLAGS_log) { std::ostringstream fn; - fn << "trickle." << message_size << "." << kilobits_per_second << ".csv"; + fn << "trickle." << (streaming ? "streaming" : "unary") << "." << req_size + << "." << resp_size << "." << kilobits_per_second << ".csv"; log_.reset(new std::ofstream(fn.str().c_str())); write_csv(log_.get(), "t", "iteration", "client_backlog", "server_backlog", "client_t_stall", "client_s_stall", @@ -242,8 +243,9 @@ static void TrickleCQNext(TrickledCHTTP2* fixture, void** t, bool* ok, static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) { EchoTestService::AsyncService service; - std::unique_ptr<TrickledCHTTP2> fixture( - new TrickledCHTTP2(&service, state.range(0), state.range(1))); + std::unique_ptr<TrickledCHTTP2> fixture(new TrickledCHTTP2( + &service, true, state.range(0) /* req_size */, + state.range(0) /* resp_size */, state.range(1) /* bw in kbit/s */)); { EchoResponse send_response; EchoResponse recv_response; @@ -314,11 +316,7 @@ static void BM_PumpStreamServerToClient_Trickle(benchmark::State& state) { state.SetBytesProcessed(state.range(0) * state.iterations()); } -/******************************************************************************* - * CONFIGURATIONS - */ - -static void TrickleArgs(benchmark::internal::Benchmark* b) { +static void StreamingTrickleArgs(benchmark::internal::Benchmark* b) { for (int i = 1; i <= 128 * 1024 * 1024; i *= 8) { for (int j = 64; j <= 128 * 1024 * 1024; j *= 8) { double expected_time = @@ -328,8 +326,111 @@ static void TrickleArgs(benchmark::internal::Benchmark* b) { } } } +BENCHMARK(BM_PumpStreamServerToClient_Trickle)->Apply(StreamingTrickleArgs); -BENCHMARK(BM_PumpStreamServerToClient_Trickle)->Apply(TrickleArgs); +static void BM_PumpUnbalancedUnary_Trickle(benchmark::State& state) { + EchoTestService::AsyncService service; + std::unique_ptr<TrickledCHTTP2> fixture(new TrickledCHTTP2( + &service, true, state.range(0) /* req_size */, + state.range(1) /* resp_size */, state.range(2) /* bw in kbit/s */)); + EchoRequest send_request; + EchoResponse send_response; + EchoResponse recv_response; + if (state.range(0) > 0) { + send_request.set_message(std::string(state.range(0), 'a')); + } + if (state.range(1) > 0) { + send_response.set_message(std::string(state.range(1), 'a')); + } + Status recv_status; + struct ServerEnv { + ServerContext ctx; + EchoRequest recv_request; + grpc::ServerAsyncResponseWriter<EchoResponse> response_writer; + ServerEnv() : response_writer(&ctx) {} + }; + uint8_t server_env_buffer[2 * sizeof(ServerEnv)]; + ServerEnv* server_env[2] = { + reinterpret_cast<ServerEnv*>(server_env_buffer), + reinterpret_cast<ServerEnv*>(server_env_buffer + sizeof(ServerEnv))}; + new (server_env[0]) ServerEnv; + new (server_env[1]) ServerEnv; + service.RequestEcho(&server_env[0]->ctx, &server_env[0]->recv_request, + &server_env[0]->response_writer, fixture->cq(), + fixture->cq(), tag(0)); + service.RequestEcho(&server_env[1]->ctx, &server_env[1]->recv_request, + &server_env[1]->response_writer, fixture->cq(), + fixture->cq(), tag(1)); + std::unique_ptr<EchoTestService::Stub> stub( + EchoTestService::NewStub(fixture->channel())); + auto inner_loop = [&](bool in_warmup) { + GPR_TIMER_SCOPE("BenchmarkCycle", 0); + recv_response.Clear(); + ClientContext cli_ctx; + std::unique_ptr<ClientAsyncResponseReader<EchoResponse>> response_reader( + stub->AsyncEcho(&cli_ctx, send_request, fixture->cq())); + void* t; + bool ok; + TrickleCQNext(fixture.get(), &t, &ok, state.iterations()); + GPR_ASSERT(ok); + GPR_ASSERT(t == tag(0) || t == tag(1)); + intptr_t slot = reinterpret_cast<intptr_t>(t); + ServerEnv* senv = server_env[slot]; + senv->response_writer.Finish(send_response, Status::OK, tag(3)); + response_reader->Finish(&recv_response, &recv_status, tag(4)); + for (int i = (1 << 3) | (1 << 4); i != 0;) { + TrickleCQNext(fixture.get(), &t, &ok, state.iterations()); + GPR_ASSERT(ok); + int tagnum = (int)reinterpret_cast<intptr_t>(t); + GPR_ASSERT(i & (1 << tagnum)); + i -= 1 << tagnum; + } + GPR_ASSERT(recv_status.ok()); + + senv->~ServerEnv(); + senv = new (senv) ServerEnv(); + service.RequestEcho(&senv->ctx, &senv->recv_request, &senv->response_writer, + fixture->cq(), fixture->cq(), tag(slot)); + }; + gpr_timespec warmup_start = gpr_now(GPR_CLOCK_MONOTONIC); + for (int i = 0; + i < GPR_MAX(FLAGS_warmup_iterations, FLAGS_warmup_megabytes * 1024 * + 1024 / (14 + state.range(0))); + i++) { + inner_loop(true); + if (gpr_time_cmp(gpr_time_sub(gpr_now(GPR_CLOCK_MONOTONIC), warmup_start), + gpr_time_from_seconds(FLAGS_warmup_max_time_seconds, + GPR_TIMESPAN)) > 0) { + break; + } + } + while (state.KeepRunning()) { + inner_loop(false); + } + fixture->Finish(state); + fixture.reset(); + server_env[0]->~ServerEnv(); + server_env[1]->~ServerEnv(); + state.SetBytesProcessed(state.range(0) * state.iterations() + + state.range(1) * state.iterations()); +} + +static void UnaryTrickleArgs(benchmark::internal::Benchmark* b) { + const int cli_1024k = 1024 * 1024; + const int cli_32M = 32 * 1024 * 1024; + const int svr_256k = 256 * 1024; + const int svr_4M = 4 * 1024 * 1024; + const int svr_64M = 64 * 1024 * 1024; + for (int bw = 64; bw <= 128 * 1024 * 1024; bw *= 16) { + b->Args({bw, cli_1024k, svr_256k}); + b->Args({bw, cli_1024k, svr_4M}); + b->Args({bw, cli_1024k, svr_64M}); + b->Args({bw, cli_32M, svr_256k}); + b->Args({bw, cli_32M, svr_4M}); + b->Args({bw, cli_32M, svr_64M}); + } +} +BENCHMARK(BM_PumpUnbalancedUnary_Trickle)->Apply(UnaryTrickleArgs); } } diff --git a/test/cpp/performance/writes_per_rpc_test.cc b/test/cpp/performance/writes_per_rpc_test.cc index 7a914c1547..12d8268330 100644 --- a/test/cpp/performance/writes_per_rpc_test.cc +++ b/test/cpp/performance/writes_per_rpc_test.cc @@ -254,8 +254,8 @@ TEST(WritesPerRpcTest, UnaryPingPong) { EXPECT_LT(UnaryPingPong(0, 0), 2.05); EXPECT_LT(UnaryPingPong(1, 0), 2.05); EXPECT_LT(UnaryPingPong(0, 1), 2.05); - EXPECT_LT(UnaryPingPong(4096, 0), 2.2); - EXPECT_LT(UnaryPingPong(0, 4096), 2.2); + EXPECT_LT(UnaryPingPong(4096, 0), 2.5); + EXPECT_LT(UnaryPingPong(0, 4096), 2.5); } } // namespace testing diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index dbd6011d86..48f24ab623 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -4205,7 +4205,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4229,7 +4230,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4253,7 +4255,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4277,7 +4280,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4303,7 +4307,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4327,7 +4332,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4351,7 +4357,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4378,7 +4385,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4405,7 +4413,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4432,7 +4441,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4459,7 +4469,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4486,7 +4497,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4513,7 +4525,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4540,7 +4553,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4567,7 +4581,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4594,7 +4609,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4621,7 +4637,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4648,7 +4665,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4675,7 +4693,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4702,7 +4721,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4729,7 +4749,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4756,7 +4777,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4783,7 +4805,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4810,7 +4833,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4837,7 +4861,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4864,7 +4889,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4891,7 +4917,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4917,7 +4944,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4941,7 +4969,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4965,7 +4994,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -4991,7 +5021,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5015,7 +5046,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5039,7 +5071,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5063,7 +5096,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5087,7 +5121,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5111,7 +5146,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5135,7 +5171,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5159,7 +5196,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5185,7 +5223,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5211,7 +5250,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5235,7 +5275,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5261,7 +5302,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5285,7 +5327,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5309,7 +5352,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5335,7 +5379,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5359,7 +5404,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5383,7 +5429,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5409,7 +5456,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5433,7 +5481,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5457,7 +5506,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5481,7 +5531,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5505,7 +5556,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5531,7 +5583,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5555,7 +5608,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5579,7 +5633,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5603,7 +5658,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5629,7 +5685,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5653,7 +5710,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5677,7 +5735,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5701,7 +5760,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5725,7 +5785,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5749,7 +5810,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5773,7 +5835,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5797,7 +5860,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", @@ -5821,7 +5885,8 @@ "cpu_cost": 1.0, "defaults": "boringssl", "exclude_configs": [ - "asan" + "asan", + "ubsan" ], "flaky": false, "language": "c++", diff --git a/tools/ubsan_suppressions.txt b/tools/ubsan_suppressions.txt index 9869f98a22..f87ed18565 100644 --- a/tools/ubsan_suppressions.txt +++ b/tools/ubsan_suppressions.txt @@ -4,4 +4,6 @@ nonnull-attribute:CBB_add_bytes nonnull-attribute:rsa_blinding_get nonnull-attribute:ssl_copy_key_material alignment:CRYPTO_cbc128_encrypt +nonnull-attribute:google::protobuf::DescriptorBuilder::BuildFileImpl +nonnull-attribute:google::protobuf::TextFormat::Printer::TextGenerator::Write |