From 5272dfca336ca9f3593e4a3070d449432ee65621 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 27 Feb 2017 20:39:35 -0800 Subject: [PATCH 01/12] Reset the keepalive timer when sending a bdp ping --- .../chttp2/transport/chttp2_transport.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 26f9449f4b9..01f74247dcb 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -488,7 +488,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->ping_policy.max_pings_without_data; t->ping_state.is_delayed_ping_timer_set = false; - /** Start client-side keepalive pings */ + /* Start client-side keepalive pings */ if (t->is_client) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING; GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); @@ -2114,6 +2114,10 @@ static void start_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, if (grpc_http_trace) { gpr_log(GPR_DEBUG, "%s: Start BDP ping", t->peer_string); } + /* Reset the keepalive ping timer */ + if (t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING) { + grpc_timer_cancel(exec_ctx, &t->keepalive_ping_timer); + } grpc_bdp_estimator_start_ping(&t->bdp_estimator); } @@ -2172,6 +2176,13 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), t->keepalive_time), &t->init_keepalive_ping_locked, gpr_now(GPR_CLOCK_MONOTONIC)); } + } else if (error == GRPC_ERROR_CANCELLED && !(t->destroying || t->closed)) { + /* The keepalive ping timer may be cancelled by bdp */ + GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); + grpc_timer_init( + exec_ctx, &t->keepalive_ping_timer, + gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), t->keepalive_time), + &t->init_keepalive_ping_locked, gpr_now(GPR_CLOCK_MONOTONIC)); } GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "init keepalive ping"); } @@ -2213,8 +2224,8 @@ static void keepalive_watchdog_fired_locked(grpc_exec_ctx *exec_ctx, void *arg, "keepalive watchdog timeout")); } } else { - /** The watchdog timer should have been cancelled by - finish_keepalive_ping_locked. */ + /* The watchdog timer should have been cancelled by + * finish_keepalive_ping_locked. */ if (error != GRPC_ERROR_CANCELLED) { gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)", t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING); From 0937fc1a30004bda3614fb8507cc15d775ab9df2 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 27 Feb 2017 23:19:00 -0800 Subject: [PATCH 02/12] Client-side keepalive pings server enforcement --- include/grpc/impl/codegen/grpc_types.h | 5 ++++ .../chttp2/transport/chttp2_transport.c | 26 ++++++++++++++++++- .../transport/chttp2/transport/frame_ping.c | 17 ++++++++++++ .../ext/transport/chttp2/transport/internal.h | 9 +++++++ .../ext/transport/chttp2/transport/writing.c | 20 ++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index aa4210b1a76..a84ce6fa2bf 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -202,6 +202,11 @@ typedef struct { a data frame or header frame) */ #define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA \ "grpc.http2.max_pings_without_data" +/** How many misbehaving pings the server can bear before sending goaway and + closing the transport? + (0 indicates that the server can bear an infinite number of misbehaving + pings) */ +#define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes" /** How much data are we willing to queue up per stream if GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ #define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 01f74247dcb..195b34a3773 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -153,6 +153,7 @@ static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, #define DEFAULT_MIN_TIME_BETWEEN_PINGS_MS 0 #define DEFAULT_MAX_PINGS_BETWEEN_DATA 3 +#define DEFAULT_MAX_PING_STRIKES 2 /** keepalive-relevant functions */ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, @@ -351,6 +352,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, .max_pings_without_data = DEFAULT_MAX_PINGS_BETWEEN_DATA, .min_time_between_pings = gpr_time_from_millis(DEFAULT_MIN_TIME_BETWEEN_PINGS_MS, GPR_TIMESPAN), + .max_ping_strikes = DEFAULT_MAX_PING_STRIKES, }; /* client-side keepalive setting */ @@ -396,6 +398,11 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->ping_policy.max_pings_without_data = grpc_channel_arg_get_integer( &channel_args->args[i], (grpc_integer_options){DEFAULT_MAX_PINGS_BETWEEN_DATA, 0, INT_MAX}); + } else if (0 == strcmp(channel_args->args[i].key, + GRPC_ARG_HTTP2_MAX_PING_STRIKES)) { + t->ping_policy.max_ping_strikes = grpc_channel_arg_get_integer( + &channel_args->args[i], + (grpc_integer_options){DEFAULT_MAX_PINGS_BETWEEN_DATA, 0, INT_MAX}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS)) { t->ping_policy.min_time_between_pings = gpr_time_from_millis( @@ -488,6 +495,9 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->ping_policy.max_pings_without_data; t->ping_state.is_delayed_ping_timer_set = false; + t->ping_recv_state.last_ping_recv_time = gpr_inf_past(GPR_CLOCK_MONOTONIC); + t->ping_recv_state.ping_strikes = 0; + /* Start client-side keepalive pings */ if (t->is_client) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING; @@ -1448,6 +1458,19 @@ static void send_goaway(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, GRPC_ERROR_UNREF(error); } +void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, + grpc_chttp2_transport *t) { + if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes && + t->ping_policy.max_ping_strikes != 0) { + send_goaway(exec_ctx, t, + grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"), + GRPC_ERROR_INT_HTTP2_ERROR, + GRPC_HTTP2_ENHANCE_YOUR_CALM)); + /*The transport will be closed after the write is done */ + close_transport_locked(exec_ctx, t, GRPC_ERROR_CREATE("Too many pings")); + } +} + static void perform_transport_op_locked(grpc_exec_ctx *exec_ctx, void *stream_op, grpc_error *error_ignored) { @@ -2163,7 +2186,8 @@ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, grpc_chttp2_transport *t = arg; GPR_ASSERT(t->keepalive_state == GRPC_CHTTP2_KEEPALIVE_STATE_WAITING); if (error == GRPC_ERROR_NONE && !(t->destroying || t->closed)) { - if (t->keepalive_permit_without_calls || t->stream_map.count > 0) { + if (t->keepalive_permit_without_calls || + grpc_chttp2_stream_map_size(&t->stream_map) > 0) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_PINGING; GRPC_CHTTP2_REF_TRANSPORT(t, "keepalive ping end"); send_ping_locked(exec_ctx, t, GRPC_CHTTP2_PING_ON_NEXT_WRITE, diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c index 46dafdb62f6..1398e55953f 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.c +++ b/src/core/ext/transport/chttp2/transport/frame_ping.c @@ -103,6 +103,23 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, if (p->is_ack) { grpc_chttp2_ack_ping(exec_ctx, t, p->opaque_8bytes); } else { + if (!t->is_client) { + gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); + gpr_timespec elapsed = + gpr_time_sub(now, t->ping_recv_state.last_ping_recv_time); + if (t->keepalive_permit_without_calls == 0 && + grpc_chttp2_stream_map_size(&t->stream_map) == 0) { + if (gpr_time_cmp(elapsed, gpr_time_from_seconds(7200, GPR_TIMESPAN)) < + 0) { + grpc_chttp2_ping_strike(exec_ctx, t); + } + } else { + if (gpr_time_cmp(elapsed, t->ping_policy.min_time_between_pings) < + 0) { + grpc_chttp2_ping_strike(exec_ctx, t); + } + } + } if (!g_disable_ping_ack) { if (t->ping_ack_count == t->ping_ack_capacity) { t->ping_ack_capacity = GPR_MAX(t->ping_ack_capacity * 3 / 2, 3); diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 50993e4ecdf..889d8ce7547 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -97,6 +97,7 @@ typedef struct { typedef struct { gpr_timespec min_time_between_pings; int max_pings_without_data; + int max_ping_strikes; } grpc_chttp2_repeated_ping_policy; typedef struct { @@ -106,6 +107,11 @@ typedef struct { bool is_delayed_ping_timer_set; } grpc_chttp2_repeated_ping_state; +typedef struct { + gpr_timespec last_ping_recv_time; + int ping_strikes; +} grpc_chttp2_server_ping_recv_state; + /* deframer state for the overall http2 stream of bytes */ typedef enum { /* prefix: one entry per http2 connection prefix byte */ @@ -316,6 +322,7 @@ struct grpc_chttp2_transport { size_t ping_ack_count; size_t ping_ack_capacity; uint64_t *ping_acks; + grpc_chttp2_server_ping_recv_state ping_recv_state; /** parser for headers */ grpc_chttp2_hpack_parser hpack_parser; @@ -792,6 +799,8 @@ void grpc_chttp2_incoming_byte_stream_finished( void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, uint64_t id); +void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t); + typedef enum { /* don't initiate a transport write, but piggyback on the next one */ GRPC_CHTTP2_STREAM_WRITE_PIGGYBACK, diff --git a/src/core/ext/transport/chttp2/transport/writing.c b/src/core/ext/transport/chttp2/transport/writing.c index 0869056f56d..be41b3d1865 100644 --- a/src/core/ext/transport/chttp2/transport/writing.c +++ b/src/core/ext/transport/chttp2/transport/writing.c @@ -229,6 +229,11 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, now_writing = true; t->ping_state.pings_before_data_required = t->ping_policy.max_pings_without_data; + if (!t->is_client) { + t->ping_recv_state.last_ping_recv_time = + gpr_inf_past(GPR_CLOCK_MONOTONIC); + t->ping_recv_state.ping_strikes = 0; + } } /* send any window updates */ if (s->announce_window > 0) { @@ -238,6 +243,11 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, s->id, s->announce_window, &s->stats.outgoing)); t->ping_state.pings_before_data_required = t->ping_policy.max_pings_without_data; + if (!t->is_client) { + t->ping_recv_state.last_ping_recv_time = + gpr_inf_past(GPR_CLOCK_MONOTONIC); + t->ping_recv_state.ping_strikes = 0; + } GRPC_CHTTP2_FLOW_DEBIT_STREAM("write", t, s, announce_window, announce); } if (sent_initial_metadata) { @@ -270,6 +280,11 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, send_bytes); t->ping_state.pings_before_data_required = t->ping_policy.max_pings_without_data; + if (!t->is_client) { + t->ping_recv_state.last_ping_recv_time = + gpr_inf_past(GPR_CLOCK_MONOTONIC); + t->ping_recv_state.ping_strikes = 0; + } if (is_last_frame) { s->send_trailing_metadata = NULL; s->sent_trailing_metadata = true; @@ -345,6 +360,11 @@ bool grpc_chttp2_begin_write(grpc_exec_ctx *exec_ctx, 0, announced, &throwaway_stats)); t->ping_state.pings_before_data_required = t->ping_policy.max_pings_without_data; + if (!t->is_client) { + t->ping_recv_state.last_ping_recv_time = + gpr_inf_past(GPR_CLOCK_MONOTONIC); + t->ping_recv_state.ping_strikes = 0; + } } for (size_t i = 0; i < t->ping_ack_count; i++) { From 187c752c6f645daaf42fa989deca601c4685de58 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 28 Feb 2017 14:07:13 -0800 Subject: [PATCH 03/12] Add min_ping_interval_without_data --- include/grpc/impl/codegen/grpc_types.h | 4 +++ .../chttp2/transport/chttp2_transport.c | 13 +++++++++- .../transport/chttp2/transport/frame_ping.c | 25 +++++++++++-------- .../ext/transport/chttp2/transport/internal.h | 1 + 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index a84ce6fa2bf..cb22785b354 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -207,6 +207,10 @@ typedef struct { (0 indicates that the server can bear an infinite number of misbehaving pings) */ #define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes" +/** Minimum allowed time between two pings without sending any data frame. Int + valued, seconds */ +#define GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S \ + "grpc.http2.min_ping_interval_without_data" /** How much data are we willing to queue up per stream if GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ #define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 195b34a3773..c4deb24e41e 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -154,6 +154,7 @@ static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, #define DEFAULT_MIN_TIME_BETWEEN_PINGS_MS 0 #define DEFAULT_MAX_PINGS_BETWEEN_DATA 3 #define DEFAULT_MAX_PING_STRIKES 2 +#define DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S 300 /** keepalive-relevant functions */ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, @@ -353,6 +354,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, .min_time_between_pings = gpr_time_from_millis(DEFAULT_MIN_TIME_BETWEEN_PINGS_MS, GPR_TIMESPAN), .max_ping_strikes = DEFAULT_MAX_PING_STRIKES, + .min_ping_interval_without_data = gpr_time_from_seconds( + DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S, GPR_TIMESPAN), }; /* client-side keepalive setting */ @@ -402,7 +405,7 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, GRPC_ARG_HTTP2_MAX_PING_STRIKES)) { t->ping_policy.max_ping_strikes = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){DEFAULT_MAX_PINGS_BETWEEN_DATA, 0, INT_MAX}); + (grpc_integer_options){DEFAULT_MAX_PING_STRIKES, 0, INT_MAX}); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS)) { t->ping_policy.min_time_between_pings = gpr_time_from_millis( @@ -411,6 +414,14 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, (grpc_integer_options){DEFAULT_MIN_TIME_BETWEEN_PINGS_MS, 0, INT_MAX}), GPR_TIMESPAN); + } else if (0 == strcmp(channel_args->args[i].key, + GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S)) { + t->ping_policy.min_ping_interval_without_data = gpr_time_from_seconds( + grpc_channel_arg_get_integer( + &channel_args->args[i], + (grpc_integer_options){DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S, + 0, INT_MAX}), + GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) { t->write_buffer_size = (uint32_t)grpc_channel_arg_get_integer( diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c index 1398e55953f..98f53bf3619 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.c +++ b/src/core/ext/transport/chttp2/transport/frame_ping.c @@ -105,19 +105,22 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, } else { if (!t->is_client) { gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); - gpr_timespec elapsed = - gpr_time_sub(now, t->ping_recv_state.last_ping_recv_time); + gpr_timespec next_allowed_ping = + gpr_time_add(t->ping_recv_state.last_ping_recv_time, + t->ping_policy.min_ping_interval_without_data); + if (t->keepalive_permit_without_calls == 0 && grpc_chttp2_stream_map_size(&t->stream_map) == 0) { - if (gpr_time_cmp(elapsed, gpr_time_from_seconds(7200, GPR_TIMESPAN)) < - 0) { - grpc_chttp2_ping_strike(exec_ctx, t); - } - } else { - if (gpr_time_cmp(elapsed, t->ping_policy.min_time_between_pings) < - 0) { - grpc_chttp2_ping_strike(exec_ctx, t); - } + /* The “2 hours” restricts the number of PINGS to an implementation + equivalent to TCP Keep-Alive, whose interval is specified to + default to no less than two hours in RFC1122. */ + next_allowed_ping = + gpr_time_add(t->ping_recv_state.last_ping_recv_time, + gpr_time_from_seconds(7200, GPR_TIMESPAN)); + } + + if (gpr_time_cmp(next_allowed_ping, now) > 0) { + grpc_chttp2_ping_strike(exec_ctx, t); } } if (!g_disable_ping_ack) { diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index 889d8ce7547..c302d4ac348 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -98,6 +98,7 @@ typedef struct { gpr_timespec min_time_between_pings; int max_pings_without_data; int max_ping_strikes; + gpr_timespec min_ping_interval_without_data; } grpc_chttp2_repeated_ping_policy; typedef struct { From af5c505fc196e09233f8de70e9e850807aac003e Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 28 Feb 2017 16:24:00 -0800 Subject: [PATCH 04/12] Add bad_ping test, fix ping test --- CMakeLists.txt | 2 + Makefile | 2 + .../transport/chttp2/transport/frame_ping.c | 2 + test/core/end2end/end2end_nosec_tests.c | 8 + test/core/end2end/end2end_tests.c | 8 + test/core/end2end/gen_build_yaml.py | 1 + test/core/end2end/generate_tests.bzl | 1 + test/core/end2end/tests/bad_ping.c | 234 +++++++++ test/core/end2end/tests/ping.c | 26 +- .../generated/sources_and_headers.json | 2 + tools/run_tests/generated/tests.json | 454 ++++++++++++++++++ .../end2end_nosec_tests.vcxproj | 2 + .../end2end_nosec_tests.vcxproj.filters | 3 + .../tests/end2end_tests/end2end_tests.vcxproj | 2 + .../end2end_tests.vcxproj.filters | 3 + 15 files changed, 742 insertions(+), 8 deletions(-) create mode 100644 test/core/end2end/tests/bad_ping.c diff --git a/CMakeLists.txt b/CMakeLists.txt index e3b2558ad29..df9cb08aa9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4391,6 +4391,7 @@ add_library(end2end_tests test/core/end2end/end2end_test_utils.c test/core/end2end/tests/authority_not_supported.c test/core/end2end/tests/bad_hostname.c + test/core/end2end/tests/bad_ping.c test/core/end2end/tests/binary_metadata.c test/core/end2end/tests/call_creds.c test/core/end2end/tests/cancel_after_accept.c @@ -4488,6 +4489,7 @@ add_library(end2end_nosec_tests test/core/end2end/end2end_test_utils.c test/core/end2end/tests/authority_not_supported.c test/core/end2end/tests/bad_hostname.c + test/core/end2end/tests/bad_ping.c test/core/end2end/tests/binary_metadata.c test/core/end2end/tests/cancel_after_accept.c test/core/end2end/tests/cancel_after_client_done.c diff --git a/Makefile b/Makefile index 7499dbbf50d..957d00dc09b 100644 --- a/Makefile +++ b/Makefile @@ -8226,6 +8226,7 @@ LIBEND2END_TESTS_SRC = \ test/core/end2end/end2end_test_utils.c \ test/core/end2end/tests/authority_not_supported.c \ test/core/end2end/tests/bad_hostname.c \ + test/core/end2end/tests/bad_ping.c \ test/core/end2end/tests/binary_metadata.c \ test/core/end2end/tests/call_creds.c \ test/core/end2end/tests/cancel_after_accept.c \ @@ -8318,6 +8319,7 @@ LIBEND2END_NOSEC_TESTS_SRC = \ test/core/end2end/end2end_test_utils.c \ test/core/end2end/tests/authority_not_supported.c \ test/core/end2end/tests/bad_hostname.c \ + test/core/end2end/tests/bad_ping.c \ test/core/end2end/tests/binary_metadata.c \ test/core/end2end/tests/cancel_after_accept.c \ test/core/end2end/tests/cancel_after_client_done.c \ diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c index 98f53bf3619..61082b97441 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.c +++ b/src/core/ext/transport/chttp2/transport/frame_ping.c @@ -122,6 +122,8 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, if (gpr_time_cmp(next_allowed_ping, now) > 0) { grpc_chttp2_ping_strike(exec_ctx, t); } + + t->ping_recv_state.last_ping_recv_time = now; } if (!g_disable_ping_ack) { if (t->ping_ack_count == t->ping_ack_capacity) { diff --git a/test/core/end2end/end2end_nosec_tests.c b/test/core/end2end/end2end_nosec_tests.c index 64bdceb2111..1187e59e6cc 100644 --- a/test/core/end2end/end2end_nosec_tests.c +++ b/test/core/end2end/end2end_nosec_tests.c @@ -49,6 +49,8 @@ extern void authority_not_supported(grpc_end2end_test_config config); extern void authority_not_supported_pre_init(void); extern void bad_hostname(grpc_end2end_test_config config); extern void bad_hostname_pre_init(void); +extern void bad_ping(grpc_end2end_test_config config); +extern void bad_ping_pre_init(void); extern void binary_metadata(grpc_end2end_test_config config); extern void binary_metadata_pre_init(void); extern void cancel_after_accept(grpc_end2end_test_config config); @@ -154,6 +156,7 @@ void grpc_end2end_tests_pre_init(void) { grpc_summon_debugger_macros(); authority_not_supported_pre_init(); bad_hostname_pre_init(); + bad_ping_pre_init(); binary_metadata_pre_init(); cancel_after_accept_pre_init(); cancel_after_client_done_pre_init(); @@ -214,6 +217,7 @@ void grpc_end2end_tests(int argc, char **argv, if (argc <= 1) { authority_not_supported(config); bad_hostname(config); + bad_ping(config); binary_metadata(config); cancel_after_accept(config); cancel_after_client_done(config); @@ -275,6 +279,10 @@ void grpc_end2end_tests(int argc, char **argv, bad_hostname(config); continue; } + if (0 == strcmp("bad_ping", argv[i])) { + bad_ping(config); + continue; + } if (0 == strcmp("binary_metadata", argv[i])) { binary_metadata(config); continue; diff --git a/test/core/end2end/end2end_tests.c b/test/core/end2end/end2end_tests.c index 37c1be41337..966031af657 100644 --- a/test/core/end2end/end2end_tests.c +++ b/test/core/end2end/end2end_tests.c @@ -49,6 +49,8 @@ extern void authority_not_supported(grpc_end2end_test_config config); extern void authority_not_supported_pre_init(void); extern void bad_hostname(grpc_end2end_test_config config); extern void bad_hostname_pre_init(void); +extern void bad_ping(grpc_end2end_test_config config); +extern void bad_ping_pre_init(void); extern void binary_metadata(grpc_end2end_test_config config); extern void binary_metadata_pre_init(void); extern void call_creds(grpc_end2end_test_config config); @@ -156,6 +158,7 @@ void grpc_end2end_tests_pre_init(void) { grpc_summon_debugger_macros(); authority_not_supported_pre_init(); bad_hostname_pre_init(); + bad_ping_pre_init(); binary_metadata_pre_init(); call_creds_pre_init(); cancel_after_accept_pre_init(); @@ -217,6 +220,7 @@ void grpc_end2end_tests(int argc, char **argv, if (argc <= 1) { authority_not_supported(config); bad_hostname(config); + bad_ping(config); binary_metadata(config); call_creds(config); cancel_after_accept(config); @@ -279,6 +283,10 @@ void grpc_end2end_tests(int argc, char **argv, bad_hostname(config); continue; } + if (0 == strcmp("bad_ping", argv[i])) { + bad_ping(config); + continue; + } if (0 == strcmp("binary_metadata", argv[i])) { binary_metadata(config); continue; diff --git a/test/core/end2end/gen_build_yaml.py b/test/core/end2end/gen_build_yaml.py index 3c5068ff3e3..d1e510d6362 100755 --- a/test/core/end2end/gen_build_yaml.py +++ b/test/core/end2end/gen_build_yaml.py @@ -93,6 +93,7 @@ LOWCPU = 0.1 END2END_TESTS = { 'authority_not_supported': default_test_options, 'bad_hostname': default_test_options, + 'bad_ping': connectivity_test_options._replace(proxyable=False), 'binary_metadata': default_test_options, 'resource_quota_server': default_test_options._replace(large_writes=True, proxyable=False), diff --git a/test/core/end2end/generate_tests.bzl b/test/core/end2end/generate_tests.bzl index 1041219f039..dc0925dc9c0 100755 --- a/test/core/end2end/generate_tests.bzl +++ b/test/core/end2end/generate_tests.bzl @@ -85,6 +85,7 @@ def test_options(needs_fullstack=False, needs_dns=False, proxyable=True, # maps test names to options END2END_TESTS = { 'bad_hostname': test_options(), + 'bad_ping': test_options(), 'binary_metadata': test_options(), 'resource_quota_server': test_options(proxyable=False), 'call_creds': test_options(secure=True), diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.c new file mode 100644 index 00000000000..97b02c90722 --- /dev/null +++ b/test/core/end2end/tests/bad_ping.c @@ -0,0 +1,234 @@ +/* + * + * Copyright 2017, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "test/core/end2end/end2end_tests.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include "test/core/end2end/cq_verifier.h" + +#define MAX_PING_STRIKES 1 + +static void *tag(intptr_t t) { return (void *)t; } + +static void drain_cq(grpc_completion_queue *cq) { + grpc_event ev; + do { + ev = grpc_completion_queue_next(cq, grpc_timeout_seconds_to_deadline(5), + NULL); + } while (ev.type != GRPC_QUEUE_SHUTDOWN); +} + +static void shutdown_server(grpc_end2end_test_fixture *f) { + if (!f->server) return; + grpc_server_destroy(f->server); + f->server = NULL; +} + +static void shutdown_client(grpc_end2end_test_fixture *f) { + if (!f->client) return; + grpc_channel_destroy(f->client); + f->client = NULL; +} + +static void end_test(grpc_end2end_test_fixture *f) { + shutdown_server(f); + shutdown_client(f); + + grpc_completion_queue_shutdown(f->cq); + drain_cq(f->cq); + grpc_completion_queue_destroy(f->cq); +} + +static void test_bad_ping(grpc_end2end_test_config config) { + grpc_end2end_test_fixture f = config.create_fixture(NULL, NULL); + cq_verifier *cqv = cq_verifier_create(f.cq); + grpc_arg client_a[] = {{.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS, + .value.integer = 0}, + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, + .value.integer = 20}}; + grpc_arg server_a[] = { + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S, + .value.integer = 300}, + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MAX_PING_STRIKES, + .value.integer = MAX_PING_STRIKES}}; + grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), + .args = client_a}; + grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), + .args = server_a}; + + config.init_client(&f, &client_args); + config.init_server(&f, &server_args); + + grpc_call *c; + grpc_call *s; + gpr_timespec deadline = grpc_timeout_seconds_to_deadline(10); + grpc_op ops[6]; + grpc_op *op; + grpc_metadata_array initial_metadata_recv; + grpc_metadata_array trailing_metadata_recv; + grpc_metadata_array request_metadata_recv; + grpc_call_details call_details; + grpc_status_code status; + grpc_call_error error; + grpc_slice details; + int was_cancelled = 2; + + c = grpc_channel_create_call( + f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, + grpc_slice_from_static_string("/foo"), + get_host_override_slice("foo.test.google.fr:1234", config), deadline, + NULL); + GPR_ASSERT(c); + + grpc_metadata_array_init(&initial_metadata_recv); + grpc_metadata_array_init(&trailing_metadata_recv); + grpc_metadata_array_init(&request_metadata_recv); + grpc_call_details_init(&call_details); + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op->data.send_initial_metadata.metadata = NULL; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_INITIAL_METADATA; + op->data.recv_initial_metadata.recv_initial_metadata = &initial_metadata_recv; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; + op->data.recv_status_on_client.trailing_metadata = &trailing_metadata_recv; + op->data.recv_status_on_client.status = &status; + op->data.recv_status_on_client.status_details = &details; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(c, ops, (size_t)(op - ops), tag(1), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + error = + grpc_server_request_call(f.server, &s, &call_details, + &request_metadata_recv, f.cq, f.cq, tag(101)); + GPR_ASSERT(GRPC_CALL_OK == error); + CQ_EXPECT_COMPLETION(cqv, tag(101), 1); + cq_verify(cqv); + + // Send too many pings to the server to trigger the punishment: + // The first ping is sent after data frames, it won't trigger a ping strike. + // Each of the following pings will trigger a ping strike, and we need at + // least (MAX_PING_STRIKES + 1) strikes to trigger the punishment. So + // (MAX_PING_STRIKES + 2) pings are needed here. + int i; + for (i = 200; i < 202 + MAX_PING_STRIKES; i++) { + grpc_channel_ping(f.client, f.cq, tag(i), NULL); + CQ_EXPECT_COMPLETION(cqv, tag(i), 1); + cq_verify(cqv); + } + + memset(ops, 0, sizeof(ops)); + op = ops; + op->op = GRPC_OP_SEND_INITIAL_METADATA; + op->data.send_initial_metadata.count = 0; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_STATUS_FROM_SERVER; + op->data.send_status_from_server.trailing_metadata_count = 0; + op->data.send_status_from_server.status = GRPC_STATUS_UNIMPLEMENTED; + grpc_slice status_details = grpc_slice_from_static_string("xyz"); + op->data.send_status_from_server.status_details = &status_details; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = NULL; + op++; + error = grpc_call_start_batch(s, ops, (size_t)(op - ops), tag(102), NULL); + GPR_ASSERT(GRPC_CALL_OK == error); + + CQ_EXPECT_COMPLETION(cqv, tag(102), 1); + CQ_EXPECT_COMPLETION(cqv, tag(1), 1); + cq_verify(cqv); + + grpc_server_shutdown_and_notify(f.server, f.cq, tag(0xdead)); + CQ_EXPECT_COMPLETION(cqv, tag(0xdead), 1); + cq_verify(cqv); + + grpc_call_destroy(s); + + // The connection should be closed immediately after the misbehaved pings, + // the in-progress RPC should fail. + GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); + GPR_ASSERT(0 == grpc_slice_str_cmp(details, "Endpoint read failed")); + GPR_ASSERT(0 == grpc_slice_str_cmp(call_details.method, "/foo")); + validate_host_override_string("foo.test.google.fr:1234", call_details.host, + config); + GPR_ASSERT(was_cancelled == 1); + + grpc_slice_unref(details); + grpc_metadata_array_destroy(&initial_metadata_recv); + grpc_metadata_array_destroy(&trailing_metadata_recv); + grpc_metadata_array_destroy(&request_metadata_recv); + grpc_call_details_destroy(&call_details); + grpc_call_destroy(c); + cq_verifier_destroy(cqv); + end_test(&f); + config.tear_down_data(&f); +} + +void bad_ping(grpc_end2end_test_config config) { + GPR_ASSERT(config.feature_mask & FEATURE_MASK_SUPPORTS_DELAYED_CONNECTION); + test_bad_ping(config); +} + +void bad_ping_pre_init(void) {} diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c index 082ac641f0b..471e02aaae4 100644 --- a/test/core/end2end/tests/ping.c +++ b/test/core/end2end/tests/ping.c @@ -52,16 +52,26 @@ static void test_ping(grpc_end2end_test_config config, grpc_connectivity_state state = GRPC_CHANNEL_IDLE; int i; - grpc_arg a[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS, - .value.integer = min_time_between_pings_ms}, - {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, - .value.integer = 20}}; - grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(a), .args = a}; + grpc_arg client_a[] = {{.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MIN_TIME_BETWEEN_PINGS_MS, + .value.integer = 0}, + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, + .value.integer = 20}}; + grpc_arg server_a[] = { + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S, + .value.integer = 0}, + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_KEEPALIVE_PERMIT_WITHOUT_CALLS, + .value.integer = 1}}; + grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), + .args = client_a}; + grpc_channel_args server_args = {.num_args = GPR_ARRAY_SIZE(server_a), + .args = server_a}; config.init_client(&f, &client_args); - config.init_server(&f, NULL); + config.init_server(&f, &server_args); grpc_channel_ping(f.client, f.cq, tag(0), NULL); CQ_EXPECT_COMPLETION(cqv, tag(0), 0); diff --git a/tools/run_tests/generated/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json index be1d8768bd5..822d02f2126 100644 --- a/tools/run_tests/generated/sources_and_headers.json +++ b/tools/run_tests/generated/sources_and_headers.json @@ -7119,6 +7119,7 @@ "test/core/end2end/end2end_tests.h", "test/core/end2end/tests/authority_not_supported.c", "test/core/end2end/tests/bad_hostname.c", + "test/core/end2end/tests/bad_ping.c", "test/core/end2end/tests/binary_metadata.c", "test/core/end2end/tests/call_creds.c", "test/core/end2end/tests/cancel_after_accept.c", @@ -7194,6 +7195,7 @@ "test/core/end2end/end2end_tests.h", "test/core/end2end/tests/authority_not_supported.c", "test/core/end2end/tests/bad_hostname.c", + "test/core/end2end/tests/bad_ping.c", "test/core/end2end/tests/binary_metadata.c", "test/core/end2end/tests/cancel_after_accept.c", "test/core/end2end/tests/cancel_after_client_done.c", diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index b878bc12310..d40d5717f41 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -5725,6 +5725,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -6925,6 +6948,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -8123,6 +8169,28 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_fakesec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -10331,6 +10399,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -11523,6 +11614,25 @@ "linux" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_test", + "platforms": [ + "linux" + ] + }, { "args": [ "binary_metadata" @@ -12519,6 +12629,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -13675,6 +13808,30 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -14921,6 +15078,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -16123,6 +16303,30 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_oauth2_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -21707,6 +21911,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_ssl_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -22907,6 +23134,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_ssl_cert_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -24109,6 +24359,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -25139,6 +25412,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_census_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -26312,6 +26608,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -28666,6 +28985,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -29701,6 +30043,25 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "linux" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_full+pipe_nosec_test", + "platforms": [ + "linux" + ] + }, { "args": [ "binary_metadata" @@ -30870,6 +31231,29 @@ "linux" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_full+trace_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -31847,6 +32231,30 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_http_proxy_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -32980,6 +33388,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -38481,6 +38912,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_nosec_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" diff --git a/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj b/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj index 5a2d6acd563..e3adf793d63 100644 --- a/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj +++ b/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj @@ -159,6 +159,8 @@ + + diff --git a/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters b/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters index 3a870b945e6..cfb8d043baf 100644 --- a/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters +++ b/vsprojects/vcxproj/test/end2end/tests/end2end_nosec_tests/end2end_nosec_tests.vcxproj.filters @@ -13,6 +13,9 @@ test\core\end2end\tests + + test\core\end2end\tests + test\core\end2end\tests diff --git a/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj b/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj index 4b001a751d8..a67f509e255 100644 --- a/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj +++ b/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj @@ -159,6 +159,8 @@ + + diff --git a/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters b/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters index 2eace64a893..97ba77a42e1 100644 --- a/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters +++ b/vsprojects/vcxproj/test/end2end/tests/end2end_tests/end2end_tests.vcxproj.filters @@ -13,6 +13,9 @@ test\core\end2end\tests + + test\core\end2end\tests + test\core\end2end\tests From 114a848972e1243543f6eb7c4dc2be1d0867504a Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 22 Mar 2017 14:34:37 -0700 Subject: [PATCH 05/12] Disable bdp probe in bad_ping test --- src/core/ext/transport/chttp2/transport/chttp2_transport.c | 1 + test/core/end2end/tests/bad_ping.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index c4deb24e41e..37553831ff3 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1471,6 +1471,7 @@ static void send_goaway(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t) { + gpr_log(GPR_DEBUG, "PING strike"); if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes && t->ping_policy.max_ping_strikes != 0) { send_goaway(exec_ctx, t, diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.c index 97b02c90722..cdeefa4f952 100644 --- a/test/core/end2end/tests/bad_ping.c +++ b/test/core/end2end/tests/bad_ping.c @@ -85,7 +85,10 @@ static void test_bad_ping(grpc_end2end_test_config config) { .value.integer = 0}, {.type = GRPC_ARG_INTEGER, .key = GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA, - .value.integer = 20}}; + .value.integer = 20}, + {.type = GRPC_ARG_INTEGER, + .key = GRPC_ARG_HTTP2_BDP_PROBE, + .value.integer = 0}}; grpc_arg server_a[] = { {.type = GRPC_ARG_INTEGER, .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S, From 78da25097d1ea4f1ccc55d244e3533eddf894915 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 24 Mar 2017 13:40:22 -0700 Subject: [PATCH 06/12] Update with the new grpc_erro interface --- .../ext/transport/chttp2/transport/chttp2_transport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 37553831ff3..173964c92ee 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1475,11 +1475,12 @@ void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes && t->ping_policy.max_ping_strikes != 0) { send_goaway(exec_ctx, t, - grpc_error_set_int(GRPC_ERROR_CREATE("too_many_pings"), - GRPC_ERROR_INT_HTTP2_ERROR, - GRPC_HTTP2_ENHANCE_YOUR_CALM)); + grpc_error_set_int( + GRPC_ERROR_CREATE_FROM_STATIC_STRING("too_many_pings"), + GRPC_ERROR_INT_HTTP2_ERROR, GRPC_HTTP2_ENHANCE_YOUR_CALM)); /*The transport will be closed after the write is done */ - close_transport_locked(exec_ctx, t, GRPC_ERROR_CREATE("Too many pings")); + close_transport_locked( + exec_ctx, t, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Too many pings")); } } From fe5934136026d612ff2b645a23b99d7991ce0380 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 27 Mar 2017 15:36:53 -0700 Subject: [PATCH 07/12] Reword comments --- .../ext/transport/chttp2/transport/chttp2_transport.c | 4 ++-- src/core/ext/transport/chttp2/transport/frame_ping.c | 8 ++++---- src/core/ext/transport/chttp2/transport/internal.h | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 173964c92ee..685e56efa87 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1469,8 +1469,8 @@ static void send_goaway(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, GRPC_ERROR_UNREF(error); } -void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, - grpc_chttp2_transport *t) { +void grpc_chttp2_add_ping_strike(grpc_exec_ctx *exec_ctx, + grpc_chttp2_transport *t) { gpr_log(GPR_DEBUG, "PING strike"); if (++t->ping_recv_state.ping_strikes > t->ping_policy.max_ping_strikes && t->ping_policy.max_ping_strikes != 0) { diff --git a/src/core/ext/transport/chttp2/transport/frame_ping.c b/src/core/ext/transport/chttp2/transport/frame_ping.c index 61082b97441..6016e43127c 100644 --- a/src/core/ext/transport/chttp2/transport/frame_ping.c +++ b/src/core/ext/transport/chttp2/transport/frame_ping.c @@ -111,16 +111,16 @@ grpc_error *grpc_chttp2_ping_parser_parse(grpc_exec_ctx *exec_ctx, void *parser, if (t->keepalive_permit_without_calls == 0 && grpc_chttp2_stream_map_size(&t->stream_map) == 0) { - /* The “2 hours” restricts the number of PINGS to an implementation - equivalent to TCP Keep-Alive, whose interval is specified to - default to no less than two hours in RFC1122. */ + /* According to RFC1122, the interval of TCP Keep-Alive is default to + no less than two hours. When there is no outstanding streams, we + restrict the number of PINGS equivalent to TCP Keep-Alive. */ next_allowed_ping = gpr_time_add(t->ping_recv_state.last_ping_recv_time, gpr_time_from_seconds(7200, GPR_TIMESPAN)); } if (gpr_time_cmp(next_allowed_ping, now) > 0) { - grpc_chttp2_ping_strike(exec_ctx, t); + grpc_chttp2_add_ping_strike(exec_ctx, t); } t->ping_recv_state.last_ping_recv_time = now; diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index c302d4ac348..d38edb5bfc2 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -800,7 +800,12 @@ void grpc_chttp2_incoming_byte_stream_finished( void grpc_chttp2_ack_ping(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, uint64_t id); -void grpc_chttp2_ping_strike(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t); +/** Add a new ping strike to ping_recv_state.ping_strikes. If + ping_recv_state.ping_strikes > ping_policy.max_ping_strikes, it sends GOAWAY + with error code ENHANCE_YOUR_CALM and additional debug data resembling + “too_many_pings” followed by immediately closing the connection. */ +void grpc_chttp2_add_ping_strike(grpc_exec_ctx *exec_ctx, + grpc_chttp2_transport *t); typedef enum { /* don't initiate a transport write, but piggyback on the next one */ From c18d4b39c808d0507f0654fdf7ecad70a9a54945 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 29 Mar 2017 15:04:42 -0700 Subject: [PATCH 08/12] Change time unit to ms --- include/grpc/impl/codegen/grpc_types.h | 8 +-- .../chttp2/transport/chttp2_transport.c | 67 ++++++++++--------- test/core/end2end/tests/bad_ping.c | 4 +- test/core/end2end/tests/keepalive_timeout.c | 6 +- test/core/end2end/tests/ping.c | 4 +- 5 files changed, 46 insertions(+), 43 deletions(-) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index cb22785b354..07d883e3e2f 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -209,17 +209,17 @@ typedef struct { #define GRPC_ARG_HTTP2_MAX_PING_STRIKES "grpc.http2.max_ping_strikes" /** Minimum allowed time between two pings without sending any data frame. Int valued, seconds */ -#define GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S \ - "grpc.http2.min_ping_interval_without_data" +#define GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS \ + "grpc.http2.min_ping_interval_without_data_ms" /** How much data are we willing to queue up per stream if GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ #define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" /** After a duration of this time the client pings the server to see if the transport is still alive. Int valued, seconds. */ -#define GRPC_ARG_CLIENT_KEEPALIVE_TIME_S "grpc.client_keepalive_time" +#define GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS "grpc.client_keepalive_time_ms" /** After waiting for a duration of this time, if the client does not receive the ping ack, it will close the transport. Int valued, seconds. */ -#define GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_S "grpc.client_keepalive_timeout" +#define GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS "grpc.client_keepalive_timeout_ms" /** Is it permissible to send keepalive pings without any outstanding streams. Int valued, 0(false)/1(true). */ #define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 685e56efa87..366cf7f2caa 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -69,13 +69,14 @@ #define MAX_WRITE_BUFFER_SIZE (64 * 1024 * 1024) #define DEFAULT_MAX_HEADER_LIST_SIZE (16 * 1024) -#define DEFAULT_CLIENT_KEEPALIVE_TIME_S INT_MAX -#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_S 20 +#define DEFAULT_CLIENT_KEEPALIVE_TIME_MS INT_MAX +#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 #define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS false -static int g_default_client_keepalive_time_s = DEFAULT_CLIENT_KEEPALIVE_TIME_S; -static int g_default_client_keepalive_timeout_s = - DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_S; +static int g_default_client_keepalive_time_ms = + DEFAULT_CLIENT_KEEPALIVE_TIME_MS; +static int g_default_client_keepalive_timeout_ms = + DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS; static bool g_default_keepalive_permit_without_calls = DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS; @@ -154,7 +155,7 @@ static void retry_initiate_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, #define DEFAULT_MIN_TIME_BETWEEN_PINGS_MS 0 #define DEFAULT_MAX_PINGS_BETWEEN_DATA 3 #define DEFAULT_MAX_PING_STRIKES 2 -#define DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S 300 +#define DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_MS 300000 /* 5 minutes */ /** keepalive-relevant functions */ static void init_keepalive_ping_locked(grpc_exec_ctx *exec_ctx, void *arg, @@ -354,21 +355,21 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, .min_time_between_pings = gpr_time_from_millis(DEFAULT_MIN_TIME_BETWEEN_PINGS_MS, GPR_TIMESPAN), .max_ping_strikes = DEFAULT_MAX_PING_STRIKES, - .min_ping_interval_without_data = gpr_time_from_seconds( - DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S, GPR_TIMESPAN), + .min_ping_interval_without_data = gpr_time_from_millis( + DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_MS, GPR_TIMESPAN), }; /* client-side keepalive setting */ t->keepalive_time = - g_default_client_keepalive_time_s == INT_MAX + g_default_client_keepalive_time_ms == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_seconds(g_default_client_keepalive_time_s, - GPR_TIMESPAN); + : gpr_time_from_millis(g_default_client_keepalive_time_ms, + GPR_TIMESPAN); t->keepalive_timeout = - g_default_client_keepalive_timeout_s == INT_MAX + g_default_client_keepalive_timeout_ms == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_seconds(g_default_client_keepalive_timeout_s, - GPR_TIMESPAN); + : gpr_time_from_millis(g_default_client_keepalive_timeout_ms, + GPR_TIMESPAN); t->keepalive_permit_without_calls = g_default_keepalive_permit_without_calls; if (channel_args) { @@ -414,13 +415,14 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, (grpc_integer_options){DEFAULT_MIN_TIME_BETWEEN_PINGS_MS, 0, INT_MAX}), GPR_TIMESPAN); - } else if (0 == strcmp(channel_args->args[i].key, - GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S)) { - t->ping_policy.min_ping_interval_without_data = gpr_time_from_seconds( + } else if (0 == + strcmp(channel_args->args[i].key, + GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS)) { + t->ping_policy.min_ping_interval_without_data = gpr_time_from_millis( grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_S, - 0, INT_MAX}), + (grpc_integer_options){ + DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_MS, 0, INT_MAX}), GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE)) { @@ -432,23 +434,23 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->enable_bdp_probe = grpc_channel_arg_get_integer( &channel_args->args[i], (grpc_integer_options){1, 0, 1}); } else if (0 == strcmp(channel_args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIME_S)) { + GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){g_default_client_keepalive_time_s, 1, + (grpc_integer_options){g_default_client_keepalive_time_ms, 1, INT_MAX}); t->keepalive_time = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_seconds(value, GPR_TIMESPAN); + : gpr_time_from_millis(value, GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_S)) { + GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){g_default_client_keepalive_timeout_s, 0, + (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0, INT_MAX}); t->keepalive_timeout = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_seconds(value, GPR_TIMESPAN); + : gpr_time_from_millis(value, GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) { t->keepalive_permit_without_calls = @@ -2172,15 +2174,16 @@ void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args) { size_t i; if (args) { for (i = 0; i < args->num_args; i++) { - if (0 == strcmp(args->args[i].key, GRPC_ARG_CLIENT_KEEPALIVE_TIME_S)) { - g_default_client_keepalive_time_s = grpc_channel_arg_get_integer( - &args->args[i], (grpc_integer_options){ - g_default_client_keepalive_time_s, 1, INT_MAX}); + if (0 == strcmp(args->args[i].key, GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS)) { + g_default_client_keepalive_time_ms = grpc_channel_arg_get_integer( + &args->args[i], + (grpc_integer_options){g_default_client_keepalive_time_ms, 1, + INT_MAX}); } else if (0 == strcmp(args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_S)) { - g_default_client_keepalive_timeout_s = grpc_channel_arg_get_integer( + GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS)) { + g_default_client_keepalive_timeout_ms = grpc_channel_arg_get_integer( &args->args[i], - (grpc_integer_options){g_default_client_keepalive_timeout_s, 0, + (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0, INT_MAX}); } else if (0 == strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) { diff --git a/test/core/end2end/tests/bad_ping.c b/test/core/end2end/tests/bad_ping.c index cdeefa4f952..01a6aeaa04f 100644 --- a/test/core/end2end/tests/bad_ping.c +++ b/test/core/end2end/tests/bad_ping.c @@ -91,8 +91,8 @@ static void test_bad_ping(grpc_end2end_test_config config) { .value.integer = 0}}; grpc_arg server_a[] = { {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S, - .value.integer = 300}, + .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS, + .value.integer = 300000 /* 5 minutes */}, {.type = GRPC_ARG_INTEGER, .key = GRPC_ARG_HTTP2_MAX_PING_STRIKES, .value.integer = MAX_PING_STRIKES}}; diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.c index 44b6e12abc7..d492585b68b 100644 --- a/test/core/end2end/tests/keepalive_timeout.c +++ b/test/core/end2end/tests/keepalive_timeout.c @@ -111,10 +111,10 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { gpr_timespec deadline = five_seconds_time(); grpc_arg keepalive_args[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_CLIENT_KEEPALIVE_TIME_S, - .value.integer = 2}, + .key = GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS, + .value.integer = 1500}, {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_S, + .key = GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS, .value.integer = 0}, {.type = GRPC_ARG_INTEGER, .key = GRPC_ARG_HTTP2_BDP_PROBE, diff --git a/test/core/end2end/tests/ping.c b/test/core/end2end/tests/ping.c index 471e02aaae4..c51c4993e25 100644 --- a/test/core/end2end/tests/ping.c +++ b/test/core/end2end/tests/ping.c @@ -60,10 +60,10 @@ static void test_ping(grpc_end2end_test_config config, .value.integer = 20}}; grpc_arg server_a[] = { {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_S, + .key = GRPC_ARG_HTTP2_MIN_PING_INTERVAL_WITHOUT_DATA_MS, .value.integer = 0}, {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_HTTP2_KEEPALIVE_PERMIT_WITHOUT_CALLS, + .key = GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS, .value.integer = 1}}; grpc_channel_args client_args = {.num_args = GPR_ARRAY_SIZE(client_a), .args = client_a}; From 5f89996e69414397a522a149b477139d9d3aadf5 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 29 Mar 2017 17:55:28 -0700 Subject: [PATCH 09/12] Enable server-side keepalive pings --- include/grpc/impl/codegen/grpc_types.h | 13 +-- .../chttp2/transport/chttp2_transport.c | 86 +++++++++++++------ .../ext/transport/chttp2/transport/internal.h | 3 +- test/core/end2end/tests/keepalive_timeout.c | 4 +- 4 files changed, 71 insertions(+), 35 deletions(-) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 07d883e3e2f..204763cd536 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -214,12 +214,13 @@ typedef struct { /** How much data are we willing to queue up per stream if GRPC_WRITE_BUFFER_HINT is set? This is an upper bound */ #define GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE "grpc.http2.write_buffer_size" -/** After a duration of this time the client pings the server to see if the - transport is still alive. Int valued, seconds. */ -#define GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS "grpc.client_keepalive_time_ms" -/** After waiting for a duration of this time, if the client does not receive - the ping ack, it will close the transport. Int valued, seconds. */ -#define GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS "grpc.client_keepalive_timeout_ms" +/** After a duration of this time the client/server pings its peer to see if the + transport is still alive. Int valued, milliseconds. */ +#define GRPC_ARG_KEEPALIVE_TIME_MS "grpc.keepalive_time_ms" +/** After waiting for a duration of this time, if the keepalive ping sender does + not receive the ping ack, it will close the transport. Int valued, + milliseconds. */ +#define GRPC_ARG_KEEPALIVE_TIMEOUT_MS "grpc.keepalive_timeout_ms" /** Is it permissible to send keepalive pings without any outstanding streams. Int valued, 0(false)/1(true). */ #define GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS \ diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 366cf7f2caa..8cdcc29f4ee 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -70,13 +70,19 @@ #define DEFAULT_MAX_HEADER_LIST_SIZE (16 * 1024) #define DEFAULT_CLIENT_KEEPALIVE_TIME_MS INT_MAX -#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 +#define DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS 20000 /* 20 seconds */ +#define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000 /* 2 hours */ +#define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000 /* 20 seconds */ #define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS false static int g_default_client_keepalive_time_ms = DEFAULT_CLIENT_KEEPALIVE_TIME_MS; static int g_default_client_keepalive_timeout_ms = DEFAULT_CLIENT_KEEPALIVE_TIMEOUT_MS; +static int g_default_server_keepalive_time_ms = + DEFAULT_SERVER_KEEPALIVE_TIME_MS; +static int g_default_server_keepalive_timeout_ms = + DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS; static bool g_default_keepalive_permit_without_calls = DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS; @@ -359,17 +365,30 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, DEFAULT_MIN_PING_INTERVAL_WITHOUT_DATA_MS, GPR_TIMESPAN), }; - /* client-side keepalive setting */ - t->keepalive_time = - g_default_client_keepalive_time_ms == INT_MAX - ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_millis(g_default_client_keepalive_time_ms, - GPR_TIMESPAN); - t->keepalive_timeout = - g_default_client_keepalive_timeout_ms == INT_MAX - ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_millis(g_default_client_keepalive_timeout_ms, - GPR_TIMESPAN); + /* Keepalive setting */ + if (t->is_client) { + t->keepalive_time = + g_default_client_keepalive_time_ms == INT_MAX + ? gpr_inf_future(GPR_TIMESPAN) + : gpr_time_from_millis(g_default_client_keepalive_time_ms, + GPR_TIMESPAN); + t->keepalive_timeout = + g_default_client_keepalive_timeout_ms == INT_MAX + ? gpr_inf_future(GPR_TIMESPAN) + : gpr_time_from_millis(g_default_client_keepalive_timeout_ms, + GPR_TIMESPAN); + } else { + t->keepalive_time = + g_default_server_keepalive_time_ms == INT_MAX + ? gpr_inf_future(GPR_TIMESPAN) + : gpr_time_from_millis(g_default_server_keepalive_time_ms, + GPR_TIMESPAN); + t->keepalive_timeout = + g_default_server_keepalive_timeout_ms == INT_MAX + ? gpr_inf_future(GPR_TIMESPAN) + : gpr_time_from_millis(g_default_server_keepalive_timeout_ms, + GPR_TIMESPAN); + } t->keepalive_permit_without_calls = g_default_keepalive_permit_without_calls; if (channel_args) { @@ -434,20 +453,24 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->enable_bdp_probe = grpc_channel_arg_get_integer( &channel_args->args[i], (grpc_integer_options){1, 0, 1}); } else if (0 == strcmp(channel_args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS)) { + GRPC_ARG_KEEPALIVE_TIME_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){g_default_client_keepalive_time_ms, 1, - INT_MAX}); + (grpc_integer_options){t->is_client + ? g_default_client_keepalive_time_ms + : g_default_server_keepalive_time_ms, + 1, INT_MAX}); t->keepalive_time = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) : gpr_time_from_millis(value, GPR_TIMESPAN); } else if (0 == strcmp(channel_args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS)) { + GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) { const int value = grpc_channel_arg_get_integer( &channel_args->args[i], - (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0, - INT_MAX}); + (grpc_integer_options){t->is_client + ? g_default_client_keepalive_timeout_ms + : g_default_server_keepalive_timeout_ms, + 0, INT_MAX}); t->keepalive_timeout = value == INT_MAX ? gpr_inf_future(GPR_TIMESPAN) : gpr_time_from_millis(value, GPR_TIMESPAN); @@ -511,8 +534,8 @@ static void init_transport(grpc_exec_ctx *exec_ctx, grpc_chttp2_transport *t, t->ping_recv_state.last_ping_recv_time = gpr_inf_past(GPR_CLOCK_MONOTONIC); t->ping_recv_state.ping_strikes = 0; - /* Start client-side keepalive pings */ - if (t->is_client) { + /* Start keepalive pings */ + if (gpr_time_cmp(t->keepalive_time, gpr_inf_future(GPR_TIMESPAN)) != 0) { t->keepalive_state = GRPC_CHTTP2_KEEPALIVE_STATE_WAITING; GRPC_CHTTP2_REF_TRANSPORT(t, "init keepalive ping"); grpc_timer_init( @@ -2170,21 +2193,32 @@ static void finish_bdp_ping_locked(grpc_exec_ctx *exec_ctx, void *tp, GRPC_CHTTP2_UNREF_TRANSPORT(exec_ctx, t, "bdp_ping"); } -void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args) { +void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, + bool is_client) { size_t i; if (args) { for (i = 0; i < args->num_args; i++) { - if (0 == strcmp(args->args[i].key, GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS)) { - g_default_client_keepalive_time_ms = grpc_channel_arg_get_integer( + if (0 == strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIME_MS)) { + const int value = grpc_channel_arg_get_integer( &args->args[i], (grpc_integer_options){g_default_client_keepalive_time_ms, 1, INT_MAX}); - } else if (0 == strcmp(args->args[i].key, - GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS)) { - g_default_client_keepalive_timeout_ms = grpc_channel_arg_get_integer( + if (is_client) { + g_default_client_keepalive_time_ms = value; + } else { + g_default_server_keepalive_time_ms = value; + } + } else if (0 == + strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_TIMEOUT_MS)) { + const int value = grpc_channel_arg_get_integer( &args->args[i], (grpc_integer_options){g_default_client_keepalive_timeout_ms, 0, INT_MAX}); + if (is_client) { + g_default_client_keepalive_timeout_ms = value; + } else { + g_default_server_keepalive_timeout_ms = value; + } } else if (0 == strcmp(args->args[i].key, GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS)) { g_default_keepalive_permit_without_calls = diff --git a/src/core/ext/transport/chttp2/transport/internal.h b/src/core/ext/transport/chttp2/transport/internal.h index d38edb5bfc2..6eb848b8d77 100644 --- a/src/core/ext/transport/chttp2/transport/internal.h +++ b/src/core/ext/transport/chttp2/transport/internal.h @@ -846,6 +846,7 @@ uint32_t grpc_chttp2_target_incoming_window(grpc_chttp2_transport *t); /** Set the default keepalive configurations, must only be called at initialization */ -void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args); +void grpc_chttp2_config_default_keepalive_args(grpc_channel_args *args, + bool is_client); #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_INTERNAL_H */ diff --git a/test/core/end2end/tests/keepalive_timeout.c b/test/core/end2end/tests/keepalive_timeout.c index d492585b68b..4b377559599 100644 --- a/test/core/end2end/tests/keepalive_timeout.c +++ b/test/core/end2end/tests/keepalive_timeout.c @@ -111,10 +111,10 @@ static void test_keepalive_timeout(grpc_end2end_test_config config) { gpr_timespec deadline = five_seconds_time(); grpc_arg keepalive_args[] = {{.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_CLIENT_KEEPALIVE_TIME_MS, + .key = GRPC_ARG_KEEPALIVE_TIME_MS, .value.integer = 1500}, {.type = GRPC_ARG_INTEGER, - .key = GRPC_ARG_CLIENT_KEEPALIVE_TIMEOUT_MS, + .key = GRPC_ARG_KEEPALIVE_TIMEOUT_MS, .value.integer = 0}, {.type = GRPC_ARG_INTEGER, .key = GRPC_ARG_HTTP2_BDP_PROBE, From ebe6baaf64237b84e9df90891355ab5bf9e678c6 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 31 Mar 2017 16:28:46 -0700 Subject: [PATCH 10/12] Double keepalive_time when the client needs to be calmed --- .../chttp2/transport/chttp2_transport.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 8cdcc29f4ee..1de36b91060 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -964,6 +964,25 @@ void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx, // GRPC_CHTTP2_IF_TRACING( // gpr_log(GPR_DEBUG, "got goaway [%d]: %s", goaway_error, msg)); t->seen_goaway = 1; + + /* When a client receives a GOAWAY with error code ENHANCE_YOUR_CALM and debug + * data equal to “too_many_pings”, it should log the occurrence at a log level + * that is enabled by default and double the configured KEEPALIVE_TIME used + * for new connections on that channel. */ + if (t->is_client && goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM && + grpc_slice_str_cmp(goaway_text, "too_many_pings") == 0) { + gpr_log(GPR_ERROR, + "Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data" + "equal to \"too_many_pings\""); + double current_keepalive_time_ms = + gpr_timespec_to_micros(t->keepalive_time) / 1000; + t->keepalive_time = + current_keepalive_time_ms > INT_MAX / 2 + ? gpr_inf_future(GPR_TIMESPAN) + : gpr_time_from_millis((int64_t)(current_keepalive_time_ms * 2), + GPR_TIMESPAN); + } + /* lie: use transient failure from the transport to indicate goaway has been * received */ connectivity_state_set( From 8b0a4d207c3c7bcc0651d3d9c0e0d5eef493f829 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Mon, 3 Apr 2017 11:24:42 -0700 Subject: [PATCH 11/12] Add KEEPALIVE_TIME_BACKOFF_MULTIPLIER macro --- .../ext/transport/chttp2/transport/chttp2_transport.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 1de36b91060..1ece5294a3e 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -74,6 +74,7 @@ #define DEFAULT_SERVER_KEEPALIVE_TIME_MS 7200000 /* 2 hours */ #define DEFAULT_SERVER_KEEPALIVE_TIMEOUT_MS 20000 /* 20 seconds */ #define DEFAULT_KEEPALIVE_PERMIT_WITHOUT_CALLS false +#define KEEPALIVE_TIME_BACKOFF_MULTIPLIER 2 static int g_default_client_keepalive_time_ms = DEFAULT_CLIENT_KEEPALIVE_TIME_MS; @@ -972,14 +973,15 @@ void grpc_chttp2_add_incoming_goaway(grpc_exec_ctx *exec_ctx, if (t->is_client && goaway_error == GRPC_HTTP2_ENHANCE_YOUR_CALM && grpc_slice_str_cmp(goaway_text, "too_many_pings") == 0) { gpr_log(GPR_ERROR, - "Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data" - "equal to \"too_many_pings\""); + "Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug " + "data equal to \"too_many_pings\""); double current_keepalive_time_ms = gpr_timespec_to_micros(t->keepalive_time) / 1000; t->keepalive_time = - current_keepalive_time_ms > INT_MAX / 2 + current_keepalive_time_ms > INT_MAX / KEEPALIVE_TIME_BACKOFF_MULTIPLIER ? gpr_inf_future(GPR_TIMESPAN) - : gpr_time_from_millis((int64_t)(current_keepalive_time_ms * 2), + : gpr_time_from_millis((int64_t)(current_keepalive_time_ms * + KEEPALIVE_TIME_BACKOFF_MULTIPLIER), GPR_TIMESPAN); } From b0c2225336d1a71ebb32f850cbec968ef9c96820 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 4 Apr 2017 11:08:19 -0700 Subject: [PATCH 12/12] generate projects --- tools/run_tests/generated/tests.json | 194 +++++++++++++-------------- 1 file changed, 97 insertions(+), 97 deletions(-) diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index d40d5717f41..88bac795e49 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -24359,29 +24359,6 @@ "posix" ] }, - { - "args": [ - "bad_ping" - ], - "ci_platforms": [ - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [ - "uv" - ], - "flaky": false, - "language": "c", - "name": "h2_uds_test", - "platforms": [ - "linux", - "mac", - "posix" - ] - }, { "args": [ "binary_metadata" @@ -25417,19 +25394,19 @@ "bad_ping" ], "ci_platforms": [ - "windows", "linux", "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], - "exclude_iomgrs": [], + "exclude_iomgrs": [ + "uv" + ], "flaky": false, "language": "c", - "name": "h2_census_nosec_test", + "name": "h2_uds_test", "platforms": [ - "windows", "linux", "mac", "posix" @@ -26623,7 +26600,7 @@ "exclude_iomgrs": [], "flaky": false, "language": "c", - "name": "h2_compress_nosec_test", + "name": "h2_census_nosec_test", "platforms": [ "windows", "linux", @@ -27808,6 +27785,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_compress_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -28985,29 +28985,6 @@ "posix" ] }, - { - "args": [ - "bad_ping" - ], - "ci_platforms": [ - "windows", - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [], - "flaky": false, - "language": "c", - "name": "h2_full_nosec_test", - "platforms": [ - "windows", - "linux", - "mac", - "posix" - ] - }, { "args": [ "binary_metadata" @@ -30048,18 +30025,22 @@ "bad_ping" ], "ci_platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ], "cpu_cost": 1.0, "exclude_configs": [], - "exclude_iomgrs": [ - "uv" - ], + "exclude_iomgrs": [], "flaky": false, "language": "c", - "name": "h2_full+pipe_nosec_test", + "name": "h2_full_nosec_test", "platforms": [ - "linux" + "windows", + "linux", + "mac", + "posix" ] }, { @@ -31236,22 +31217,18 @@ "bad_ping" ], "ci_platforms": [ - "windows", - "linux", - "mac", - "posix" + "linux" ], "cpu_cost": 1.0, "exclude_configs": [], - "exclude_iomgrs": [], + "exclude_iomgrs": [ + "uv" + ], "flaky": false, "language": "c", - "name": "h2_full+trace_nosec_test", + "name": "h2_full+pipe_nosec_test", "platforms": [ - "windows", - "linux", - "mac", - "posix" + "linux" ] }, { @@ -32238,16 +32215,15 @@ "ci_platforms": [ "windows", "linux", + "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], - "exclude_iomgrs": [ - "uv" - ], + "exclude_iomgrs": [], "flaky": false, "language": "c", - "name": "h2_http_proxy_nosec_test", + "name": "h2_full+trace_nosec_test", "platforms": [ "windows", "linux", @@ -33395,15 +33371,16 @@ "ci_platforms": [ "windows", "linux", - "mac", "posix" ], "cpu_cost": 1.0, "exclude_configs": [], - "exclude_iomgrs": [], + "exclude_iomgrs": [ + "uv" + ], "flaky": false, "language": "c", - "name": "h2_load_reporting_nosec_test", + "name": "h2_http_proxy_nosec_test", "platforms": [ "windows", "linux", @@ -34633,6 +34610,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "windows", + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [], + "flaky": false, + "language": "c", + "name": "h2_load_reporting_nosec_test", + "platforms": [ + "windows", + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata" @@ -38912,29 +38912,6 @@ "posix" ] }, - { - "args": [ - "bad_ping" - ], - "ci_platforms": [ - "linux", - "mac", - "posix" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "exclude_iomgrs": [ - "uv" - ], - "flaky": false, - "language": "c", - "name": "h2_uds_nosec_test", - "platforms": [ - "linux", - "mac", - "posix" - ] - }, { "args": [ "binary_metadata" @@ -40073,6 +40050,29 @@ "posix" ] }, + { + "args": [ + "bad_ping" + ], + "ci_platforms": [ + "linux", + "mac", + "posix" + ], + "cpu_cost": 1.0, + "exclude_configs": [], + "exclude_iomgrs": [ + "uv" + ], + "flaky": false, + "language": "c", + "name": "h2_uds_nosec_test", + "platforms": [ + "linux", + "mac", + "posix" + ] + }, { "args": [ "binary_metadata"