From ce8f977593dc111e9c1516accbbb88913812090f Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Mon, 1 Aug 2016 16:06:00 -0400 Subject: [PATCH 001/123] Call orphan_cb before FD shutdown --- src/core/lib/iomgr/udp_server.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 48032412a2e..12e929fa6a8 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -171,6 +171,8 @@ static void deactivated_all_ports(grpc_exec_ctx *exec_ctx, grpc_udp_server *s) { sp->destroyed_closure.cb = destroyed_port; sp->destroyed_closure.cb_arg = s; + /* Call the orphan_cb to signal that the FD is about to be closed and + * should no longer be used. */ GPR_ASSERT(sp->orphan_cb); sp->orphan_cb(sp->emfd); @@ -197,6 +199,11 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, /* shutdown all fd's */ if (s->active_ports) { for (i = 0; i < s->nports; i++) { + /* Call the orphan_cb to signal that the FD is about to be closed and + * should no longer be used. */ + GPR_ASSERT(sp->orphan_cb); + sp->orphan_cb(sp->emfd); + grpc_fd_shutdown(exec_ctx, s->ports[i].emfd); } gpr_mu_unlock(&s->mu); From 26f90888d6d98322974a75dc8938dc070edea4c5 Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Tue, 2 Aug 2016 15:26:00 -0400 Subject: [PATCH 002/123] Remove GRPC_NEED_UDP ifdefs --- src/core/lib/iomgr/udp_server.c | 2 -- test/core/iomgr/udp_server_test.c | 8 -------- 2 files changed, 10 deletions(-) diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 48032412a2e..f68288169b7 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -38,7 +38,6 @@ #include -#ifdef GRPC_NEED_UDP #ifdef GPR_POSIX_SOCKET #include "src/core/lib/iomgr/udp_server.h" @@ -439,4 +438,3 @@ void grpc_udp_server_start(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, } #endif -#endif diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index a959a7e07fa..2a304275043 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -48,8 +48,6 @@ #include "src/core/lib/iomgr/iomgr.h" #include "test/core/util/test_config.h" -#ifdef GRPC_NEED_UDP - #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", #x) static grpc_pollset *g_pollset; @@ -229,9 +227,3 @@ int main(int argc, char **argv) { grpc_iomgr_shutdown(); return 0; } - -#else - -int main(int argc, char **argv) { return 0; } - -#endif From cb78540024d485b69a6477c69ccf03048f90cc9a Mon Sep 17 00:00:00 2001 From: tania-m Date: Thu, 8 Sep 2016 20:28:26 +0200 Subject: [PATCH 003/123] Update greeter_client.js Switched declaration order --- examples/node/static_codegen/greeter_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/node/static_codegen/greeter_client.js b/examples/node/static_codegen/greeter_client.js index da80cf34d8e..9b93e003a5c 100644 --- a/examples/node/static_codegen/greeter_client.js +++ b/examples/node/static_codegen/greeter_client.js @@ -39,13 +39,13 @@ var grpc = require('grpc'); function main() { var client = new services.GreeterClient('localhost:50051', grpc.credentials.createInsecure()); + var request = new messages.HelloRequest(); var user; if (process.argv.length >= 3) { user = process.argv[2]; } else { user = 'world'; } - var request = new messages.HelloRequest(); request.setName(user); client.sayHello(request, function(err, response) { console.log('Greeting:', response.getMessage()); From 930c2983d34507765305a56c329c2e354168184b Mon Sep 17 00:00:00 2001 From: Dan Born Date: Thu, 8 Sep 2016 19:12:18 -0700 Subject: [PATCH 004/123] Safe server shutdown. --- .../server/secure/server_secure_chttp2.c | 196 ++++++++++-------- src/core/lib/iomgr/tcp_server_posix.c | 36 ++-- test/core/iomgr/tcp_server_posix_test.c | 3 +- 3 files changed, 131 insertions(+), 104 deletions(-) diff --git a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c index da3e284fcf2..563271f4f8c 100644 --- a/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c +++ b/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.c @@ -61,13 +61,12 @@ typedef struct server_secure_state { grpc_server_credentials *creds; bool is_shutdown; gpr_mu mu; - gpr_refcount refcount; - grpc_closure destroy_closure; - grpc_closure *destroy_callback; + grpc_closure tcp_server_shutdown_complete; + grpc_closure *server_destroy_listener_done; } server_secure_state; typedef struct server_secure_connect { - server_secure_state *state; + server_secure_state *server_state; grpc_pollset *accepting_pollset; grpc_tcp_server_acceptor *acceptor; grpc_handshake_manager *handshake_mgr; @@ -77,39 +76,28 @@ typedef struct server_secure_connect { grpc_channel_args *args; } server_secure_connect; -static void state_ref(server_secure_state *state) { gpr_ref(&state->refcount); } - -static void state_unref(server_secure_state *state) { - if (gpr_unref(&state->refcount)) { - /* ensure all threads have unlocked */ - gpr_mu_lock(&state->mu); - gpr_mu_unlock(&state->mu); - /* clean up */ - GRPC_SECURITY_CONNECTOR_UNREF(&state->sc->base, "server"); - grpc_server_credentials_unref(state->creds); - gpr_free(state); - } -} - static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep, grpc_security_status status, grpc_endpoint *secure_endpoint, grpc_auth_context *auth_context) { - server_secure_connect *state = statep; + server_secure_connect *connection_state = statep; if (status == GRPC_SECURITY_OK) { if (secure_endpoint) { - gpr_mu_lock(&state->state->mu); - if (!state->state->is_shutdown) { + gpr_mu_lock(&connection_state->server_state->mu); + if (!connection_state->server_state->is_shutdown) { grpc_transport *transport = grpc_create_chttp2_transport( - exec_ctx, grpc_server_get_channel_args(state->state->server), + exec_ctx, grpc_server_get_channel_args( + connection_state->server_state->server), secure_endpoint, 0); grpc_arg args_to_add[2]; - args_to_add[0] = grpc_server_credentials_to_arg(state->state->creds); + args_to_add[0] = grpc_server_credentials_to_arg( + connection_state->server_state->creds); args_to_add[1] = grpc_auth_context_to_arg(auth_context); grpc_channel_args *args_copy = grpc_channel_args_copy_and_add( - state->args, args_to_add, GPR_ARRAY_SIZE(args_to_add)); - grpc_server_setup_transport(exec_ctx, state->state->server, transport, - state->accepting_pollset, args_copy); + connection_state->args, args_to_add, GPR_ARRAY_SIZE(args_to_add)); + grpc_server_setup_transport( + exec_ctx, connection_state->server_state->server, transport, + connection_state->accepting_pollset, args_copy); grpc_channel_args_destroy(args_copy); grpc_chttp2_transport_start_reading(exec_ctx, transport, NULL); } else { @@ -117,21 +105,21 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *statep, * gone away. */ grpc_endpoint_destroy(exec_ctx, secure_endpoint); } - gpr_mu_unlock(&state->state->mu); + gpr_mu_unlock(&connection_state->server_state->mu); } } else { gpr_log(GPR_ERROR, "Secure transport failed with error %d", status); } - grpc_channel_args_destroy(state->args); - state_unref(state->state); - gpr_free(state); + grpc_channel_args_destroy(connection_state->args); + grpc_tcp_server_unref(exec_ctx, connection_state->server_state->tcp); + gpr_free(connection_state); } static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, grpc_channel_args *args, gpr_slice_buffer *read_buffer, void *user_data, grpc_error *error) { - server_secure_connect *state = user_data; + server_secure_connect *connection_state = user_data; if (error != GRPC_ERROR_NONE) { const char *error_str = grpc_error_string(error); gpr_log(GPR_ERROR, "Handshaking failed: %s", error_str); @@ -139,81 +127,107 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, grpc_endpoint *endpoint, GRPC_ERROR_UNREF(error); grpc_channel_args_destroy(args); gpr_free(read_buffer); - grpc_handshake_manager_shutdown(exec_ctx, state->handshake_mgr); - grpc_handshake_manager_destroy(exec_ctx, state->handshake_mgr); - state_unref(state->state); - gpr_free(state); + grpc_handshake_manager_shutdown(exec_ctx, connection_state->handshake_mgr); + grpc_handshake_manager_destroy(exec_ctx, connection_state->handshake_mgr); + grpc_tcp_server_unref(exec_ctx, connection_state->server_state->tcp); + gpr_free(connection_state); return; } - grpc_handshake_manager_destroy(exec_ctx, state->handshake_mgr); - state->handshake_mgr = NULL; + grpc_handshake_manager_destroy(exec_ctx, connection_state->handshake_mgr); + connection_state->handshake_mgr = NULL; // TODO(roth, jboeuf): Convert security connector handshaking to use new // handshake API, and then move the code from on_secure_handshake_done() // into this function. - state->args = args; + connection_state->args = args; grpc_server_security_connector_do_handshake( - exec_ctx, state->state->sc, state->acceptor, endpoint, read_buffer, - state->deadline, on_secure_handshake_done, state); + exec_ctx, connection_state->server_state->sc, connection_state->acceptor, + endpoint, read_buffer, connection_state->deadline, + on_secure_handshake_done, connection_state); } static void on_accept(grpc_exec_ctx *exec_ctx, void *statep, grpc_endpoint *tcp, grpc_pollset *accepting_pollset, grpc_tcp_server_acceptor *acceptor) { - server_secure_connect *state = gpr_malloc(sizeof(*state)); - state->state = statep; - state_ref(state->state); - state->accepting_pollset = accepting_pollset; - state->acceptor = acceptor; - state->handshake_mgr = grpc_handshake_manager_create(); + server_secure_state *server_state = statep; + server_secure_connect *connection_state = NULL; + gpr_mu_lock(&server_state->mu); + if (server_state->is_shutdown) { + gpr_mu_unlock(&server_state->mu); + grpc_endpoint_destroy(exec_ctx, tcp); + return; + } + gpr_mu_unlock(&server_state->mu); + grpc_tcp_server_ref(server_state->tcp); + connection_state = gpr_malloc(sizeof(*connection_state)); + connection_state->server_state = server_state; + connection_state->accepting_pollset = accepting_pollset; + connection_state->acceptor = acceptor; + connection_state->handshake_mgr = grpc_handshake_manager_create(); // TODO(roth): We should really get this timeout value from channel // args instead of hard-coding it. - state->deadline = gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC), - gpr_time_from_seconds(120, GPR_TIMESPAN)); + connection_state->deadline = gpr_time_add( + gpr_now(GPR_CLOCK_MONOTONIC), gpr_time_from_seconds(120, GPR_TIMESPAN)); grpc_handshake_manager_do_handshake( - exec_ctx, state->handshake_mgr, tcp, - grpc_server_get_channel_args(state->state->server), state->deadline, - acceptor, on_handshake_done, state); + exec_ctx, connection_state->handshake_mgr, tcp, + grpc_server_get_channel_args(connection_state->server_state->server), + connection_state->deadline, acceptor, on_handshake_done, + connection_state); } /* Server callback: start listening on our ports */ -static void start(grpc_exec_ctx *exec_ctx, grpc_server *server, void *statep, - grpc_pollset **pollsets, size_t pollset_count) { - server_secure_state *state = statep; - grpc_tcp_server_start(exec_ctx, state->tcp, pollsets, pollset_count, - on_accept, state); +static void server_start_listener(grpc_exec_ctx *exec_ctx, grpc_server *server, + void *statep, grpc_pollset **pollsets, + size_t pollset_count) { + server_secure_state *server_state = statep; + gpr_mu_lock(&server_state->mu); + server_state->is_shutdown = false; + gpr_mu_unlock(&server_state->mu); + grpc_tcp_server_start(exec_ctx, server_state->tcp, pollsets, pollset_count, + on_accept, server_state); } -static void destroy_done(grpc_exec_ctx *exec_ctx, void *statep, - grpc_error *error) { - server_secure_state *state = statep; - if (state->destroy_callback != NULL) { - state->destroy_callback->cb(exec_ctx, state->destroy_callback->cb_arg, - GRPC_ERROR_REF(error)); +static void tcp_server_shutdown_complete(grpc_exec_ctx *exec_ctx, void *statep, + grpc_error *error) { + server_secure_state *server_state = statep; + /* ensure all threads have unlocked */ + gpr_mu_lock(&server_state->mu); + grpc_closure *destroy_done = server_state->server_destroy_listener_done; + GPR_ASSERT(server_state->is_shutdown); + gpr_mu_unlock(&server_state->mu); + /* clean up */ + grpc_server_security_connector_shutdown(exec_ctx, server_state->sc); + + /* Flush queued work before a synchronous unref. */ + grpc_exec_ctx_flush(exec_ctx); + GRPC_SECURITY_CONNECTOR_UNREF(&server_state->sc->base, "server"); + grpc_server_credentials_unref(server_state->creds); + + if (destroy_done != NULL) { + destroy_done->cb(exec_ctx, destroy_done->cb_arg, GRPC_ERROR_REF(error)); + grpc_exec_ctx_flush(exec_ctx); } - grpc_server_security_connector_shutdown(exec_ctx, state->sc); - state_unref(state); + gpr_free(server_state); } -/* Server callback: destroy the tcp listener (so we don't generate further - callbacks) */ -static void destroy(grpc_exec_ctx *exec_ctx, grpc_server *server, void *statep, - grpc_closure *callback) { - server_secure_state *state = statep; +static void server_destroy_listener(grpc_exec_ctx *exec_ctx, + grpc_server *server, void *statep, + grpc_closure *callback) { + server_secure_state *server_state = statep; grpc_tcp_server *tcp; - gpr_mu_lock(&state->mu); - state->is_shutdown = true; - state->destroy_callback = callback; - tcp = state->tcp; - gpr_mu_unlock(&state->mu); + gpr_mu_lock(&server_state->mu); + server_state->is_shutdown = true; + server_state->server_destroy_listener_done = callback; + tcp = server_state->tcp; + gpr_mu_unlock(&server_state->mu); grpc_tcp_server_shutdown_listeners(exec_ctx, tcp); - grpc_tcp_server_unref(exec_ctx, tcp); + grpc_tcp_server_unref(exec_ctx, server_state->tcp); } int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, grpc_server_credentials *creds) { grpc_resolved_addresses *resolved = NULL; grpc_tcp_server *tcp = NULL; - server_secure_state *state = NULL; + server_secure_state *server_state = NULL; size_t i; size_t count = 0; int port_num = -1; @@ -253,22 +267,22 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, if (err != GRPC_ERROR_NONE) { goto error; } - state = gpr_malloc(sizeof(*state)); - memset(state, 0, sizeof(*state)); - grpc_closure_init(&state->destroy_closure, destroy_done, state); - err = grpc_tcp_server_create(&state->destroy_closure, + server_state = gpr_malloc(sizeof(*server_state)); + memset(server_state, 0, sizeof(*server_state)); + grpc_closure_init(&server_state->tcp_server_shutdown_complete, + tcp_server_shutdown_complete, server_state); + err = grpc_tcp_server_create(&server_state->tcp_server_shutdown_complete, grpc_server_get_channel_args(server), &tcp); if (err != GRPC_ERROR_NONE) { goto error; } - state->server = server; - state->tcp = tcp; - state->sc = sc; - state->creds = grpc_server_credentials_ref(creds); - state->is_shutdown = false; - gpr_mu_init(&state->mu); - gpr_ref_init(&state->refcount, 1); + server_state->server = server; + server_state->tcp = tcp; + server_state->sc = sc; + server_state->creds = grpc_server_credentials_ref(creds); + server_state->is_shutdown = true; + gpr_mu_init(&server_state->mu); errors = gpr_malloc(sizeof(*errors) * resolved->naddrs); for (i = 0; i < resolved->naddrs; i++) { @@ -313,7 +327,8 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, grpc_resolved_addresses_destroy(resolved); /* Register with the server only upon success */ - grpc_server_add_listener(&exec_ctx, server, state, start, destroy); + grpc_server_add_listener(&exec_ctx, server, server_state, + server_start_listener, server_destroy_listener); grpc_exec_ctx_finish(&exec_ctx); return port_num; @@ -334,10 +349,11 @@ error: grpc_tcp_server_unref(&exec_ctx, tcp); } else { if (sc) { + grpc_exec_ctx_flush(&exec_ctx); GRPC_SECURITY_CONNECTOR_UNREF(&sc->base, "server"); } - if (state) { - gpr_free(state); + if (server_state) { + gpr_free(server_state); } } grpc_exec_ctx_finish(&exec_ctx); diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index 2d3f6cf9a7d..5f846c8afb1 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -191,6 +191,9 @@ grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete, } static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { + gpr_mu_lock(&s->mu); + GPR_ASSERT(s->shutdown); + gpr_mu_unlock(&s->mu); if (s->shutdown_complete != NULL) { grpc_exec_ctx_sched(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE, NULL); } @@ -652,6 +655,7 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, unsigned port_index) { unsigned num_fds = 0; grpc_tcp_listener *sp; + gpr_mu_lock(&s->mu); for (sp = s->head; sp && port_index != 0; sp = sp->next) { if (!sp->is_sibling) { --port_index; @@ -659,12 +663,15 @@ unsigned grpc_tcp_server_port_fd_count(grpc_tcp_server *s, } for (; sp; sp = sp->sibling, ++num_fds) ; + gpr_mu_unlock(&s->mu); return num_fds; } int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index, unsigned fd_index) { grpc_tcp_listener *sp; + int fd; + gpr_mu_lock(&s->mu); for (sp = s->head; sp && port_index != 0; sp = sp->next) { if (!sp->is_sibling) { --port_index; @@ -673,10 +680,12 @@ int grpc_tcp_server_port_fd(grpc_tcp_server *s, unsigned port_index, for (; sp && fd_index != 0; sp = sp->sibling, --fd_index) ; if (sp) { - return sp->fd; + fd = sp->fd; } else { - return -1; + fd = -1; } + gpr_mu_unlock(&s->mu); + return fd; } void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s, @@ -722,7 +731,7 @@ void grpc_tcp_server_start(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s, } grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) { - gpr_ref(&s->refs); + gpr_ref_non_zero(&s->refs); return s; } @@ -736,18 +745,21 @@ void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s, void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { if (gpr_unref(&s->refs)) { - /* Complete shutdown_starting work before destroying. */ grpc_exec_ctx local_exec_ctx = GRPC_EXEC_CTX_INIT; + bool finish_ctx = false; + /* FIXME: API allows a NULL exec_ctx, although this might cause us to delete + ourself before some enqueued work in some other exec_ctx runs. */ + if (exec_ctx == NULL) { + exec_ctx = &local_exec_ctx; + finish_ctx = true; + } + grpc_tcp_server_shutdown_listeners(exec_ctx, s); gpr_mu_lock(&s->mu); - grpc_exec_ctx_enqueue_list(&local_exec_ctx, &s->shutdown_starting, NULL); + grpc_exec_ctx_enqueue_list(exec_ctx, &s->shutdown_starting, NULL); gpr_mu_unlock(&s->mu); - if (exec_ctx == NULL) { - grpc_exec_ctx_flush(&local_exec_ctx); - tcp_server_destroy(&local_exec_ctx, s); - grpc_exec_ctx_finish(&local_exec_ctx); - } else { - grpc_exec_ctx_finish(&local_exec_ctx); - tcp_server_destroy(exec_ctx, s); + tcp_server_destroy(exec_ctx, s); + if (finish_ctx) { + grpc_exec_ctx_finish(exec_ctx); } } } diff --git a/test/core/iomgr/tcp_server_posix_test.c b/test/core/iomgr/tcp_server_posix_test.c index 6e2d1d0fc9e..6b1dd428a13 100644 --- a/test/core/iomgr/tcp_server_posix_test.c +++ b/test/core/iomgr/tcp_server_posix_test.c @@ -314,11 +314,10 @@ static void test_connect(unsigned n) { GPR_ASSERT(grpc_tcp_server_port_fd(s, 0, 0) >= 0); grpc_tcp_server_unref(&exec_ctx, s); + grpc_exec_ctx_finish(&exec_ctx); /* Weak ref lost. */ GPR_ASSERT(weak_ref.server == NULL); - - grpc_exec_ctx_finish(&exec_ctx); } static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, From 1ed0b8e3d72abcc4788e89cab4caa4e8c0083985 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 14 Sep 2016 15:01:16 -0700 Subject: [PATCH 005/123] Add interop test for Cacheable Unary Calls modified interop test spec doc added CacheableUnaryCall to test.proto modified server and client implmenentations to support new method --- doc/interop-test-descriptions.md | 21 +++++++++++++++ src/proto/grpc/testing/test.proto | 5 ++++ test/cpp/interop/client.cc | 4 +++ test/cpp/interop/interop_client.cc | 43 ++++++++++++++++++++++++++++++ test/cpp/interop/interop_client.h | 1 + test/cpp/interop/interop_server.cc | 11 ++++++++ 6 files changed, 85 insertions(+) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 1e04966380c..5b3ad2335cc 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -60,6 +60,27 @@ Client asserts: *It may be possible to use UnaryCall instead of EmptyCall, but it is harder to ensure that the proto serialized to zero bytes.* +### cacheable_unary + +This test verifies that gRPC requests marked as cacheable use GET verb instead +of POST, and that server sets appropriate cache control headers for the response +to be cached by a proxy. This interop test requires that the server is behind +a caching proxy. It is NOT expected to pass if client is accessing the server +directly. + +Server features: +* [CacheableUnaryCall][] + +Procedure: + 1. Client calls CacheableUnaryCall twice, and compares the two responses. + The server generates a unique response (timestamp) for each request. + If the second response was delivered from cache, then both responses will + be the same. + +Client asserts: +* call was successful +* responses are the same. + ### large_unary This test verifies unary calls succeed in sending messages, and touches on flow diff --git a/src/proto/grpc/testing/test.proto b/src/proto/grpc/testing/test.proto index 84369db4b8a..b52c4cbad6c 100644 --- a/src/proto/grpc/testing/test.proto +++ b/src/proto/grpc/testing/test.proto @@ -47,6 +47,11 @@ service TestService { // One request followed by one response. rpc UnaryCall(SimpleRequest) returns (SimpleResponse); + // One request followed by one response. Response has cache control + // headers set such that a caching HTTP proxy (such as GFE) can + // satisfy subsequent requests. + rpc CacheableUnaryCall(SimpleRequest) returns (SimpleResponse); + // One request followed by a sequence of responses (streamed download). // The server returns the payload with client desired type and sizes. rpc StreamingOutputCall(StreamingOutputCallRequest) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index e8ae6ee5723..8cbb1feeafc 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -148,6 +148,8 @@ int main(int argc, char** argv) { client.DoStatusWithMessage(); } else if (FLAGS_test_case == "custom_metadata") { client.DoCustomMetadata(); + } else if (FLAGS_test_case == "cacheable_unary") { + client.DoCacheableUnary(); } else if (FLAGS_test_case == "all") { client.DoEmpty(); client.DoLargeUnary(); @@ -165,6 +167,7 @@ int main(int argc, char** argv) { client.DoEmptyStream(); client.DoStatusWithMessage(); client.DoCustomMetadata(); + client.DoCacheableUnary(); // service_account_creds and jwt_token_creds can only run with ssl. if (FLAGS_use_tls) { grpc::string json_key = GetServiceAccountJsonKey(); @@ -176,6 +179,7 @@ int main(int argc, char** argv) { // compute_engine_creds only runs in GCE. } else { const char* testcases[] = {"all", + "cacheable_unary", "cancel_after_begin", "cancel_after_first_response", "client_compressed_streaming", diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 8861bc1163c..f2290adfc3b 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -845,6 +845,49 @@ bool InteropClient::DoStatusWithMessage() { return true; } +bool InteropClient::DoCacheableUnary() { + gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); + + SimpleRequest request; + request.set_response_size(16); + grpc::string payload(16, '\0'); + request.mutable_payload()->set_body(payload.c_str(), 16); + + // Request 1 + ClientContext context1; + SimpleResponse response1; + context1.set_cacheable(true); + // Add fake user IP since some proxy's (GFE) won't cache requests from + // localhost. + context1.AddMetadata("x-user-ip", "1.2.3.4"); + Status s1 = + serviceStub_.Get()->CacheableUnaryCall(&context1, request, &response1); + if (!AssertStatusOk(s1)) { + return false; + } + gpr_log(GPR_DEBUG, "response 1 payload: %s", + response1.payload().body().c_str()); + + // Request 2 + ClientContext context2; + SimpleResponse response2; + context2.set_cacheable(true); + context2.AddMetadata("x-user-ip", "1.2.3.4"); + Status s2 = + serviceStub_.Get()->CacheableUnaryCall(&context2, request, &response2); + if (!AssertStatusOk(s2)) { + return false; + } + gpr_log(GPR_DEBUG, "response 1 payload: %s", + response2.payload().body().c_str()); + + // Check that the body is same for both requests. It will be the same if the + // second response is a cached copy of the first response + GPR_ASSERT(response2.payload().body() == response1.payload().body()); + + return true; +} + bool InteropClient::DoCustomMetadata() { const grpc::string kEchoInitialMetadataKey("x-grpc-test-echo-initial"); const grpc::string kInitialMetadataValue("test_initial_metadata_value"); diff --git a/test/cpp/interop/interop_client.h b/test/cpp/interop/interop_client.h index eb886fcb7e2..1e89f0987d5 100644 --- a/test/cpp/interop/interop_client.h +++ b/test/cpp/interop/interop_client.h @@ -79,6 +79,7 @@ class InteropClient { bool DoEmptyStream(); bool DoStatusWithMessage(); bool DoCustomMetadata(); + bool DoCacheableUnary(); // Auth tests. // username is a string containing the user email bool DoJwtTokenCreds(const grpc::string& username); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index e5878bb248c..ac2567eba02 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -47,6 +47,7 @@ #include #include +#include "src/core/lib/support/string.h" #include "src/core/lib/transport/byte_stream.h" #include "src/proto/grpc/testing/empty.grpc.pb.h" #include "src/proto/grpc/testing/messages.grpc.pb.h" @@ -152,6 +153,16 @@ class TestServiceImpl : public TestService::Service { return Status::OK; } + // Response contains current timestamp. We ignore everything in the request. + Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, + SimpleResponse* response) { + gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + std::string timestamp = std::to_string(ts.tv_nsec); + response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); + context->AddInitialMetadata("Cache-Control", "max-age=100000, public"); + return Status::OK; + } + Status UnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { MaybeEchoMetadata(context); From c809be2af5dab9041c310cefc68f40977409f85e Mon Sep 17 00:00:00 2001 From: bithavoc Date: Fri, 16 Sep 2016 10:36:58 -0500 Subject: [PATCH 006/123] Fix ruby readme link to grpc quickstart --- src/ruby/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ruby/README.md b/src/ruby/README.md index 31795754866..67e94dd3540 100644 --- a/src/ruby/README.md +++ b/src/ruby/README.md @@ -73,5 +73,5 @@ Directory structure is the layout for [ruby extensions][] [ruby extensions]:http://guides.rubygems.org/gems-with-extensions/ [rubydoc]: http://www.rubydoc.info/gems/grpc -[grpc.io]: http://www.grpc.io/docs/installation/ruby.html +[grpc.io]: http://www.grpc.io/docs/quickstart/ruby.html [Debian jessie-backports]:http://backports.debian.org/Instructions/ From 9c79e8de96c168c40691bebf8db18c6acd3e813b Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 14:33:18 +0200 Subject: [PATCH 007/123] add matrix run script --- tools/run_tests/run_tests_in_workspace.sh | 44 ++++ tools/run_tests/run_tests_matrix.py | 239 ++++++++++++++++++++++ 2 files changed, 283 insertions(+) create mode 100755 tools/run_tests/run_tests_in_workspace.sh create mode 100755 tools/run_tests/run_tests_matrix.py diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh new file mode 100755 index 00000000000..0e7604dbc55 --- /dev/null +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2015, 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. +# +# Create a workspace in a subdirectory to allow running multiple builds in isolation. +# WORKSPACE_NAME env variable needs to contain name of the workspace to create. +# All cmdline args will be passed to run_tests.py script (executed in the +# newly created workspace) +set -ex + +cd $(dirname $0)/../.. + +rm -rf "${WORKSPACE_NAME}" +git clone --recursive . "${WORKSPACE_NAME}" + +echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" +"${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ + diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py new file mode 100755 index 00000000000..2344e2f9fd8 --- /dev/null +++ b/tools/run_tests/run_tests_matrix.py @@ -0,0 +1,239 @@ +#!/usr/bin/env python2.7 +# Copyright 2015, 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. + +"""Run test matrix.""" + +import argparse +import jobset +import os +import report_utils +import sys + +_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) +os.chdir(_ROOT) + +# TODO(jtattermusch): this is not going to be enough for sanitizers. +_RUNTESTS_TIMEOUT = 30*60 + + +def _docker_jobspec(name, runtests_args=[]): + """Run a single instance of run_tests.py in a docker container""" + # TODO: fix copying report files from inside docker.... + test_job = jobset.JobSpec( + cmdline=['python', 'tools/run_tests/run_tests.py', + '--use_docker', + '-t', + '-j', '3', + '-x', 'report_%s.xml' % name] + runtests_args, + shortname='run_tests_%s' % name, + timeout_seconds=_RUNTESTS_TIMEOUT) + return test_job + + +def _workspace_jobspec(name, runtests_args=[], workspace_name=None): + """Run a single instance of run_tests.py in a separate workspace""" + env = {'WORKSPACE_NAME': workspace_name} + test_job = jobset.JobSpec( + cmdline=['tools/run_tests/run_tests_in_workspace.sh', + '-t', + '-j', '3', + '-x', '../report_%s.xml' % name] + runtests_args, + environ=env, + shortname='run_tests_%s' % name, + timeout_seconds=_RUNTESTS_TIMEOUT) + return test_job + + +def _generate_jobs(languages, configs, platforms, + arch=None, compiler=None, + labels=[]): + result = [] + for language in languages: + for platform in platforms: + for config in configs: + name = '%s_%s_%s' % (language, platform, config) + runtests_args = ['-l', language, + '-c', config] + if arch or compiler: + name += '_%s_%s' % (arch, compiler) + runtests_args += ['--arch', arch, + '--compiler', compiler] + + if platform == 'linux': + job = _docker_jobspec(name=name, runtests_args=runtests_args) + else: + job = _workspace_jobspec(name=name, runtests_args=runtests_args) + + job.labels = [platform, config, language] + labels + result.append(job) + return result + + +def _create_test_jobs(): + test_jobs = [] + # supported on linux only + test_jobs += _generate_jobs(languages=['sanity', 'php7'], + configs=['dbg', 'opt'], + platforms=['linux'], + labels=['basictests']) + + # supported on all platforms. + test_jobs += _generate_jobs(languages=['c', 'csharp', 'node', 'python'], + configs=['dbg', 'opt'], + platforms=['linux', 'macos', 'windows'], + labels=['basictests']) + + # supported on linux and mac. + test_jobs += _generate_jobs(languages=['c++', 'ruby', 'php'], + configs=['dbg', 'opt'], + platforms=['linux', 'macos'], + labels=['basictests']) + + # supported on mac only. + test_jobs += _generate_jobs(languages=['objc'], + configs=['dbg', 'opt'], + platforms=['macos'], + labels=['basictests']) + + # sanitizers + test_jobs += _generate_jobs(languages=['c'], + configs=['msan', 'asan', 'tsan'], + platforms=['linux'], + labels=['sanitizers']) + test_jobs += _generate_jobs(languages=['c++'], + configs=['asan', 'tsan'], + platforms=['linux'], + labels=['sanitizers']) + return test_jobs + + +def _create_portability_test_jobs(): + test_jobs = [] + # portability C x86 + test_jobs += _generate_jobs(languages=['c'], + configs=['dbg'], + platforms=['linux'], + arch='x86', + compiler='default', + labels=['portability']) + + # portability C and C++ on x64 + for compiler in ['gcc4.4', 'gcc4.6', 'gcc5.3', + 'clang3.5', 'clang3.6', 'clang3.7']: + test_jobs += _generate_jobs(languages=['c', 'c++'], + configs=['dbg'], + platforms=['linux'], + arch='x64', + compiler=compiler, + labels=['portability']) + + # portability C on Windows + for arch in ['x86', 'x64']: + for compiler in ['vs2013', 'vs2015']: + test_jobs += _generate_jobs(languages=['c'], + configs=['dbg'], + platforms=['windows'], + arch=arch, + compiler=compiler, + labels=['portability']) + + test_jobs += _generate_jobs(languages=['python'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler='python3.4', + labels=['portability']) + + test_jobs += _generate_jobs(languages=['csharp'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler='coreclr', + labels=['portability']) + + for compiler in ['node5', 'node6', 'node0.12']: + test_jobs += _generate_jobs(languages=['node'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler=compiler, + labels=['portability']) + return test_jobs + + +all_jobs = _create_test_jobs() + _create_portability_test_jobs() + +all_labels = set() +for job in all_jobs: + for label in job.labels: + all_labels.add(label) + +argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +argp.add_argument('-f', '--filter', + choices=sorted(all_labels), + nargs='+', + default=[], + help='Filter targets to run by label with AND semantics.') +args = argp.parse_args() + +jobs = [] +for job in all_jobs: + if not args.filter or all(filter in job.labels for filter in args.filter): + jobs.append(job) + +if not jobs: + jobset.message('FAILED', 'No test suites match given criteria.', + do_newline=True) + sys.exit(1) + +print('IMPORTANT: The changes you are testing need to be locally committed') +print('because only the committed changes in the current branch will be') +print('copied to the docker environment or into subworkspaces.') + +print +print 'Will run these tests:' +for job in jobs: + print ' %s' % job.shortname +print + +jobset.message('START', 'Running test matrix.', do_newline=True) +num_failures, resultset = jobset.run(jobs, + newline_on_success=True, + travis=True, + maxjobs=2) +report_utils.render_junit_xml_report(resultset, 'report.xml') + +if num_failures == 0: + jobset.message('SUCCESS', 'All run_tests.py instance finished successfully.', + do_newline=True) +else: + jobset.message('FAILED', 'Some run_tests.py instance have failed.', + do_newline=True) + sys.exit(1) From ba5196acdda6a72f689d5c793f2a2526423e1b55 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 18:20:37 +0200 Subject: [PATCH 008/123] improve report collection --- tools/run_tests/dockerize/docker_run_tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 8c6143d24f9..ef02d266253 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -63,6 +63,7 @@ echo '' >> index.html cd .. zip -r reports.zip reports -find . -name report.xml | xargs zip reports.zip +find . -name report.xml | xargs -r zip reports.zip +find . -name 'report_*.xml' | xargs -r zip reports.zip exit $exit_code From a1906d5ea7b445c465ce368b7f8c0c8f396279a3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 18:37:17 +0200 Subject: [PATCH 009/123] run matrix improvements --- .../dockerize/build_docker_and_run_tests.sh | 12 ++++++------ tools/run_tests/run_tests_in_workspace.sh | 2 ++ tools/run_tests/run_tests_matrix.py | 17 ++++++++++++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh index c2ea6f2c6eb..b4b172ddef6 100755 --- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh +++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh @@ -44,9 +44,6 @@ mkdir -p /tmp/ccache # its cache location now that --download-cache is deprecated). mkdir -p /tmp/xdg-cache-home -# Create a local branch so the child Docker script won't complain -git branch -f jenkins-docker - # Inputs # DOCKERFILE_DIR - Directory in which Dockerfile file is located. # DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root) @@ -86,9 +83,12 @@ docker run \ $DOCKER_IMAGE_NAME \ bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_FAILED="true" -docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" $git_root || true -unzip -o $git_root/reports.zip -d $git_root || true -rm -f reports.zip +# use unique name for reports.zip to prevent clash between concurrent +# run_tests.py runs +TEMP_REPORTS_ZIP=`mktemp` +docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" ${TEMP_REPORTS_ZIP} || true +unzip -o ${TEMP_REPORTS_ZIP} -d $git_root || true +rm -f ${TEMP_REPORTS_ZIP} # remove the container, possibly killing it first docker rm -f $CONTAINER_NAME || true diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh index 0e7604dbc55..b0c9ad05f76 100755 --- a/tools/run_tests/run_tests_in_workspace.sh +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -37,6 +37,8 @@ set -ex cd $(dirname $0)/../.. rm -rf "${WORKSPACE_NAME}" +# TODO(jtattermusch): clone --recursive fetches the submodules from github. +# Try avoiding that to save time and network capacity. git clone --recursive . "${WORKSPACE_NAME}" echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 2344e2f9fd8..bc2e37abd89 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -32,6 +32,7 @@ import argparse import jobset +import multiprocessing import os import report_utils import sys @@ -40,8 +41,12 @@ _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdir(_ROOT) # TODO(jtattermusch): this is not going to be enough for sanitizers. +# TODO(jtattermusch): this is not going to be enough for rebuilding clang docker. _RUNTESTS_TIMEOUT = 30*60 +# Number of jobs assigned to each run_tests.py instance +_INNER_JOBS = 2 + def _docker_jobspec(name, runtests_args=[]): """Run a single instance of run_tests.py in a docker container""" @@ -50,7 +55,7 @@ def _docker_jobspec(name, runtests_args=[]): cmdline=['python', 'tools/run_tests/run_tests.py', '--use_docker', '-t', - '-j', '3', + '-j', str(_INNER_JOBS), '-x', 'report_%s.xml' % name] + runtests_args, shortname='run_tests_%s' % name, timeout_seconds=_RUNTESTS_TIMEOUT) @@ -59,11 +64,13 @@ def _docker_jobspec(name, runtests_args=[]): def _workspace_jobspec(name, runtests_args=[], workspace_name=None): """Run a single instance of run_tests.py in a separate workspace""" + if not workspace_name: + workspace_name = 'workspace_%s' % name env = {'WORKSPACE_NAME': workspace_name} test_job = jobset.JobSpec( cmdline=['tools/run_tests/run_tests_in_workspace.sh', '-t', - '-j', '3', + '-j', str(_INNER_JOBS), '-x', '../report_%s.xml' % name] + runtests_args, environ=env, shortname='run_tests_%s' % name, @@ -196,6 +203,10 @@ for job in all_jobs: all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +argp.add_argument('-j', '--jobs', + default=multiprocessing.cpu_count()/_INNER_JOBS, + type=int, + help='Number of concurrent run_tests.py instances.') argp.add_argument('-f', '--filter', choices=sorted(all_labels), nargs='+', @@ -227,7 +238,7 @@ jobset.message('START', 'Running test matrix.', do_newline=True) num_failures, resultset = jobset.run(jobs, newline_on_success=True, travis=True, - maxjobs=2) + maxjobs=args.jobs) report_utils.render_junit_xml_report(resultset, 'report.xml') if num_failures == 0: From 060eb8794a9064fd046952c16dba096ce364eeac Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 20 Sep 2016 16:06:13 +0200 Subject: [PATCH 010/123] address some TODOs --- tools/run_tests/run_tests_matrix.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index bc2e37abd89..06ab02e32fb 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -40,9 +40,9 @@ import sys _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdir(_ROOT) -# TODO(jtattermusch): this is not going to be enough for sanitizers. -# TODO(jtattermusch): this is not going to be enough for rebuilding clang docker. -_RUNTESTS_TIMEOUT = 30*60 +# Set the timeout high to allow enough time for sanitizers and pre-building +# clang docker. +_RUNTESTS_TIMEOUT = 2*60*60 # Number of jobs assigned to each run_tests.py instance _INNER_JOBS = 2 @@ -50,7 +50,6 @@ _INNER_JOBS = 2 def _docker_jobspec(name, runtests_args=[]): """Run a single instance of run_tests.py in a docker container""" - # TODO: fix copying report files from inside docker.... test_job = jobset.JobSpec( cmdline=['python', 'tools/run_tests/run_tests.py', '--use_docker', @@ -203,6 +202,8 @@ for job in all_jobs: all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +# TODO(jtattermusch): allow running tests with --build_only flag +# TODO(jtattermusch): allow running tests with --force_default_poller flag. argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count()/_INNER_JOBS, type=int, From 6d7c6ef332376def2d0666e4f721ae6fba7176a3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 13:40:48 +0200 Subject: [PATCH 011/123] support passing extra args to run_tests.py --- tools/run_tests/run_tests_matrix.py | 90 +++++++++++++++++++---------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 06ab02e32fb..ae7fdd84f9b 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -79,7 +79,7 @@ def _workspace_jobspec(name, runtests_args=[], workspace_name=None): def _generate_jobs(languages, configs, platforms, arch=None, compiler=None, - labels=[]): + labels=[], extra_args=[]): result = [] for language in languages: for platform in platforms: @@ -92,6 +92,7 @@ def _generate_jobs(languages, configs, platforms, runtests_args += ['--arch', arch, '--compiler', compiler] + runtests_args += extra_args if platform == 'linux': job = _docker_jobspec(name=name, runtests_args=runtests_args) else: @@ -102,45 +103,51 @@ def _generate_jobs(languages, configs, platforms, return result -def _create_test_jobs(): +def _create_test_jobs(extra_args=[]): test_jobs = [] # supported on linux only test_jobs += _generate_jobs(languages=['sanity', 'php7'], configs=['dbg', 'opt'], platforms=['linux'], - labels=['basictests']) + labels=['basictests'], + extra_args=extra_args) # supported on all platforms. test_jobs += _generate_jobs(languages=['c', 'csharp', 'node', 'python'], - configs=['dbg', 'opt'], - platforms=['linux', 'macos', 'windows'], - labels=['basictests']) + configs=['dbg', 'opt'], + platforms=['linux', 'macos', 'windows'], + labels=['basictests'], + extra_args=extra_args) # supported on linux and mac. test_jobs += _generate_jobs(languages=['c++', 'ruby', 'php'], - configs=['dbg', 'opt'], - platforms=['linux', 'macos'], - labels=['basictests']) + configs=['dbg', 'opt'], + platforms=['linux', 'macos'], + labels=['basictests'], + extra_args=extra_args) # supported on mac only. test_jobs += _generate_jobs(languages=['objc'], configs=['dbg', 'opt'], platforms=['macos'], - labels=['basictests']) + labels=['basictests'], + extra_args=extra_args) # sanitizers test_jobs += _generate_jobs(languages=['c'], configs=['msan', 'asan', 'tsan'], platforms=['linux'], - labels=['sanitizers']) + labels=['sanitizers'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['c++'], configs=['asan', 'tsan'], platforms=['linux'], - labels=['sanitizers']) + labels=['sanitizers'], + extra_args=extra_args) return test_jobs -def _create_portability_test_jobs(): +def _create_portability_test_jobs(extra_args=[]): test_jobs = [] # portability C x86 test_jobs += _generate_jobs(languages=['c'], @@ -148,7 +155,8 @@ def _create_portability_test_jobs(): platforms=['linux'], arch='x86', compiler='default', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) # portability C and C++ on x64 for compiler in ['gcc4.4', 'gcc4.6', 'gcc5.3', @@ -158,7 +166,8 @@ def _create_portability_test_jobs(): platforms=['linux'], arch='x64', compiler=compiler, - labels=['portability']) + labels=['portability'], + extra_args=extra_args) # portability C on Windows for arch in ['x86', 'x64']: @@ -168,53 +177,72 @@ def _create_portability_test_jobs(): platforms=['windows'], arch=arch, compiler=compiler, - labels=['portability']) + labels=['portability'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['python'], configs=['dbg'], platforms=['linux'], arch='default', compiler='python3.4', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['csharp'], configs=['dbg'], platforms=['linux'], arch='default', compiler='coreclr', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) for compiler in ['node5', 'node6', 'node0.12']: test_jobs += _generate_jobs(languages=['node'], - configs=['dbg'], - platforms=['linux'], - arch='default', - compiler=compiler, - labels=['portability']) + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler=compiler, + labels=['portability'], + extra_args=extra_args) return test_jobs -all_jobs = _create_test_jobs() + _create_portability_test_jobs() +def _allowed_labels(): + """Returns a list of existing job labels.""" + all_labels = set() + for job in _create_test_jobs() + _create_portability_test_jobs(): + for label in job.labels: + all_labels.add(label) + return sorted(all_labels) -all_labels = set() -for job in all_jobs: - for label in job.labels: - all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') -# TODO(jtattermusch): allow running tests with --build_only flag -# TODO(jtattermusch): allow running tests with --force_default_poller flag. argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count()/_INNER_JOBS, type=int, help='Number of concurrent run_tests.py instances.') argp.add_argument('-f', '--filter', - choices=sorted(all_labels), + choices=_allowed_labels(), nargs='+', default=[], help='Filter targets to run by label with AND semantics.') +argp.add_argument('--build_only', + default=False, + action='store_const', + const=True, + help='Pass --build_only flag to run_tests.py instances.') +argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, + help='Pass --force_default_poller to run_tests.py instances.') args = argp.parse_args() +extra_args = [] +if args.build_only: + extra_args.append('--build_only') +if args.force_default_poller: + extra_args.append('--force_default_poller') + +all_jobs = _create_test_jobs(extra_args=extra_args) + _create_portability_test_jobs(extra_args=extra_args) + jobs = [] for job in all_jobs: if not args.filter or all(filter in job.labels for filter in args.filter): From 1c037a30441466ed06d9e11c7e56e749afc99bed Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:28:07 +0200 Subject: [PATCH 012/123] node6 portability test not yet implemented --- tools/run_tests/run_tests_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index ae7fdd84f9b..d87632d8891 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -196,7 +196,7 @@ def _create_portability_test_jobs(extra_args=[]): labels=['portability'], extra_args=extra_args) - for compiler in ['node5', 'node6', 'node0.12']: + for compiler in ['node5', 'node0.12']: test_jobs += _generate_jobs(languages=['node'], configs=['dbg'], platforms=['linux'], From c1e44906f87fbd6552a5ed3cc372cce1ec170cbb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:31:10 +0200 Subject: [PATCH 013/123] support --dry_run flag --- tools/run_tests/run_tests_matrix.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index d87632d8891..a31b0dd9177 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -233,6 +233,11 @@ argp.add_argument('--build_only', help='Pass --build_only flag to run_tests.py instances.') argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, help='Pass --force_default_poller to run_tests.py instances.') +argp.add_argument('--dry_run', + default=False, + action='store_const', + const=True, + help='Only print what would be run.') args = argp.parse_args() extra_args = [] @@ -263,6 +268,10 @@ for job in jobs: print ' %s' % job.shortname print +if args.dry_run: + print '--dry_run was used, exiting' + sys.exit(1) + jobset.message('START', 'Running test matrix.', do_newline=True) num_failures, resultset = jobset.run(jobs, newline_on_success=True, From 7b9c21ab2c467df62ab3c871e6544cfb70a23a44 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:44:27 +0200 Subject: [PATCH 014/123] better --dry_run printouts --- tools/run_tests/run_tests_matrix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index a31b0dd9177..d5f90478257 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -265,7 +265,10 @@ print('copied to the docker environment or into subworkspaces.') print print 'Will run these tests:' for job in jobs: - print ' %s' % job.shortname + if args.dry_run: + print ' %s: "%s"' % (job.shortname, ' '.join(job.cmdline)) + else: + print ' %s' % job.shortname print if args.dry_run: From e26ab6c5610b9cc4878f6db77700b918272dfc80 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Thu, 22 Sep 2016 15:13:07 -0700 Subject: [PATCH 015/123] Adding a method in channel creds to remove any attached call creds. This will be useful when talking to non-trusted load balancer (balancers which are not able to impersonate real backends) as these balancers should not receive bearer tokens. --- .../composite/composite_credentials.c | 11 ++++++- .../composite/composite_credentials.h | 4 +-- .../lib/security/credentials/credentials.c | 12 +++++++ .../lib/security/credentials/credentials.h | 10 ++++++ .../credentials/fake/fake_credentials.c | 2 +- .../credentials/ssl/ssl_credentials.c | 2 +- test/core/security/credentials_test.c | 31 +++++++++++++++++-- 7 files changed, 65 insertions(+), 7 deletions(-) diff --git a/src/core/lib/security/credentials/composite/composite_credentials.c b/src/core/lib/security/credentials/composite/composite_credentials.c index 850e41e6460..d55d00b7b66 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.c +++ b/src/core/lib/security/credentials/composite/composite_credentials.c @@ -242,8 +242,17 @@ static grpc_security_status composite_channel_create_security_connector( return status; } +static grpc_channel_credentials * +composite_channel_duplicate_without_call_credentials( + grpc_channel_credentials *creds) { + grpc_composite_channel_credentials *c = + (grpc_composite_channel_credentials *)creds; + return grpc_channel_credentials_ref(c->inner_creds); +} + static grpc_channel_credentials_vtable composite_channel_credentials_vtable = { - composite_channel_destruct, composite_channel_create_security_connector}; + composite_channel_destruct, composite_channel_create_security_connector, + composite_channel_duplicate_without_call_credentials}; grpc_channel_credentials *grpc_composite_channel_credentials_create( grpc_channel_credentials *channel_creds, grpc_call_credentials *call_creds, diff --git a/src/core/lib/security/credentials/composite/composite_credentials.h b/src/core/lib/security/credentials/composite/composite_credentials.h index 0d8966f464d..f8425c2b765 100644 --- a/src/core/lib/security/credentials/composite/composite_credentials.h +++ b/src/core/lib/security/credentials/composite/composite_credentials.h @@ -53,7 +53,7 @@ grpc_call_credentials *grpc_credentials_contains_type( grpc_call_credentials *creds, const char *type, grpc_call_credentials **composite_creds); -/* -- Channel composite credentials. -- */ +/* -- Composite channel credentials. -- */ typedef struct { grpc_channel_credentials base; @@ -61,7 +61,7 @@ typedef struct { grpc_call_credentials *call_creds; } grpc_composite_channel_credentials; -/* -- Composite credentials. -- */ +/* -- Composite call credentials. -- */ typedef struct { grpc_call_credentials base; diff --git a/src/core/lib/security/credentials/credentials.c b/src/core/lib/security/credentials/credentials.c index 029a3572616..1149e5c2edb 100644 --- a/src/core/lib/security/credentials/credentials.c +++ b/src/core/lib/security/credentials/credentials.c @@ -138,6 +138,18 @@ grpc_security_status grpc_channel_credentials_create_security_connector( channel_creds, NULL, target, args, sc, new_args); } +grpc_channel_credentials * +grpc_channel_credentials_duplicate_without_call_credentials( + grpc_channel_credentials *channel_creds) { + if (channel_creds != NULL && channel_creds->vtable != NULL && + channel_creds->vtable->duplicate_without_call_credentials != NULL) { + return channel_creds->vtable->duplicate_without_call_credentials( + channel_creds); + } else { + return grpc_channel_credentials_ref(channel_creds); + } +} + grpc_server_credentials *grpc_server_credentials_ref( grpc_server_credentials *creds) { if (creds == NULL) return NULL; diff --git a/src/core/lib/security/credentials/credentials.h b/src/core/lib/security/credentials/credentials.h index 8e9d842eadd..6fb5b5b15ad 100644 --- a/src/core/lib/security/credentials/credentials.h +++ b/src/core/lib/security/credentials/credentials.h @@ -107,6 +107,9 @@ typedef struct { grpc_channel_credentials *c, grpc_call_credentials *call_creds, const char *target, const grpc_channel_args *args, grpc_channel_security_connector **sc, grpc_channel_args **new_args); + + grpc_channel_credentials *(*duplicate_without_call_credentials)( + grpc_channel_credentials *c); } grpc_channel_credentials_vtable; struct grpc_channel_credentials { @@ -128,6 +131,13 @@ grpc_security_status grpc_channel_credentials_create_security_connector( const grpc_channel_args *args, grpc_channel_security_connector **sc, grpc_channel_args **new_args); +/* Creates a version of the channel credentials without any attached call + credentials. This can be used in order to open a channel to a non-trusted + gRPC load balancer. */ +grpc_channel_credentials * +grpc_channel_credentials_duplicate_without_call_credentials( + grpc_channel_credentials *creds); + /* --- grpc_credentials_md. --- */ typedef struct { diff --git a/src/core/lib/security/credentials/fake/fake_credentials.c b/src/core/lib/security/credentials/fake/fake_credentials.c index 51cafd986fb..ea4cb76fb99 100644 --- a/src/core/lib/security/credentials/fake/fake_credentials.c +++ b/src/core/lib/security/credentials/fake/fake_credentials.c @@ -61,7 +61,7 @@ fake_transport_security_server_create_security_connector( static grpc_channel_credentials_vtable fake_transport_security_credentials_vtable = { - NULL, fake_transport_security_create_security_connector}; + NULL, fake_transport_security_create_security_connector, NULL}; static grpc_server_credentials_vtable fake_transport_security_server_credentials_vtable = { diff --git a/src/core/lib/security/credentials/ssl/ssl_credentials.c b/src/core/lib/security/credentials/ssl/ssl_credentials.c index 545bca9d98b..0dc1fccec4a 100644 --- a/src/core/lib/security/credentials/ssl/ssl_credentials.c +++ b/src/core/lib/security/credentials/ssl/ssl_credentials.c @@ -95,7 +95,7 @@ static grpc_security_status ssl_create_security_connector( } static grpc_channel_credentials_vtable ssl_vtable = { - ssl_destruct, ssl_create_security_connector}; + ssl_destruct, ssl_create_security_connector, NULL}; static void ssl_build_config(const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, diff --git a/test/core/security/credentials_test.c b/test/core/security/credentials_test.c index 7043953154a..2f8ffe4da64 100644 --- a/test/core/security/credentials_test.c +++ b/test/core/security/credentials_test.c @@ -46,6 +46,7 @@ #include "src/core/lib/http/httpcli.h" #include "src/core/lib/security/credentials/composite/composite_credentials.h" +#include "src/core/lib/security/credentials/fake/fake_credentials.h" #include "src/core/lib/security/credentials/google_default/google_default_credentials.h" #include "src/core/lib/security/credentials/jwt/jwt_credentials.h" #include "src/core/lib/security/credentials/oauth2/oauth2_credentials.h" @@ -411,7 +412,7 @@ static grpc_security_status check_channel_oauth2_create_security_connector( static void test_channel_oauth2_composite_creds(void) { grpc_channel_args *new_args; grpc_channel_credentials_vtable vtable = { - NULL, check_channel_oauth2_create_security_connector}; + NULL, check_channel_oauth2_create_security_connector, NULL}; grpc_channel_credentials *channel_creds = grpc_mock_channel_credentials_create(&vtable); grpc_call_credentials *oauth2_creds = @@ -495,7 +496,7 @@ check_channel_oauth2_google_iam_create_security_connector( static void test_channel_oauth2_google_iam_composite_creds(void) { grpc_channel_args *new_args; grpc_channel_credentials_vtable vtable = { - NULL, check_channel_oauth2_google_iam_create_security_connector}; + NULL, check_channel_oauth2_google_iam_create_security_connector, NULL}; grpc_channel_credentials *channel_creds = grpc_mock_channel_credentials_create(&vtable); grpc_call_credentials *oauth2_creds = @@ -1148,6 +1149,31 @@ static void test_get_well_known_google_credentials_file_path(void) { #endif } +static void test_channel_creds_duplicate_without_call_creds(void) { + grpc_channel_credentials *channel_creds = + grpc_fake_transport_security_credentials_create(); + + grpc_channel_credentials *dup = + grpc_channel_credentials_duplicate_without_call_credentials( + channel_creds); + GPR_ASSERT(dup == channel_creds); + grpc_channel_credentials_unref(dup); + + grpc_call_credentials *call_creds = + grpc_access_token_credentials_create("blah", NULL); + grpc_channel_credentials *composite_creds = + grpc_composite_channel_credentials_create(channel_creds, call_creds, + NULL); + grpc_call_credentials_unref(call_creds); + dup = grpc_channel_credentials_duplicate_without_call_credentials( + composite_creds); + GPR_ASSERT(dup == channel_creds); + grpc_channel_credentials_unref(dup); + + grpc_channel_credentials_unref(channel_creds); + grpc_channel_credentials_unref(composite_creds); +} + int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_init(); @@ -1182,6 +1208,7 @@ int main(int argc, char **argv) { test_metadata_plugin_success(); test_metadata_plugin_failure(); test_get_well_known_google_credentials_file_path(); + test_channel_creds_duplicate_without_call_creds(); grpc_shutdown(); return 0; } From 27170357abbb9609b9f0ac47c1926a7eb383ca67 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Fri, 23 Sep 2016 14:14:18 -0700 Subject: [PATCH 016/123] Improve ProtoReflectionDescriptorDatabase --- build.yaml | 1 - test/cpp/util/proto_reflection_descriptor_database.cc | 9 ++++++--- test/cpp/util/proto_reflection_descriptor_database.h | 2 +- tools/run_tests/sources_and_headers.json | 3 +-- vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj | 3 --- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/build.yaml b/build.yaml index 3701c0d8149..5e7b5bbe00b 100644 --- a/build.yaml +++ b/build.yaml @@ -1094,7 +1094,6 @@ libs: deps: - grpc++_reflection - grpc++ - - grpc++_test_config - name: grpc_plugin_support build: protoc language: c++ diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index f0d14c686a3..ae633ea7f4e 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -314,13 +314,16 @@ ProtoReflectionDescriptorDatabase::GetStream() { return stream_; } -void ProtoReflectionDescriptorDatabase::DoOneRequest( +bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { + bool request_succeed = false; stream_mutex_.lock(); - GetStream()->Write(request); - GetStream()->Read(&response); + if (GetStream()->Write(request) && GetStream()->Read(&response)) { + request_succeed = true; + } stream_mutex_.unlock(); + return request_succeed; } } // namespace grpc diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h index 0e69696d5fb..54114f10814 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.h +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -111,7 +111,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase { const std::shared_ptr GetStream(); - void DoOneRequest( + bool DoOneRequest( const grpc::reflection::v1alpha::ServerReflectionRequest& request, grpc::reflection::v1alpha::ServerReflectionResponse& response); diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1b8f19a298d..38357e193d6 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -4693,8 +4693,7 @@ { "deps": [ "grpc++", - "grpc++_reflection", - "grpc++_test_config" + "grpc++_reflection" ], "headers": [ "test/cpp/util/cli_call.h", diff --git a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj index 2790884ee1b..4c61baa506d 100644 --- a/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj +++ b/vsprojects/vcxproj/grpc_cli_libs/grpc_cli_libs.vcxproj @@ -176,9 +176,6 @@ {C187A093-A0FE-489D-A40A-6E33DE0F9FEB} - - {3F7D093D-11F9-C4BC-BEB7-18EB28E3F290} - From 0e08b861a908611377a4cb6ba23d6f0422e9d102 Mon Sep 17 00:00:00 2001 From: Julien Boeuf Date: Mon, 26 Sep 2016 10:24:07 -0700 Subject: [PATCH 017/123] Updating roots from Mozilla. --- etc/roots.pem | 111 -------------------------------------------------- 1 file changed, 111 deletions(-) diff --git a/etc/roots.pem b/etc/roots.pem index d376e58ff50..79357e01f2b 100644 --- a/etc/roots.pem +++ b/etc/roots.pem @@ -1706,38 +1706,6 @@ fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- -# Issuer: CN=IGC/A O=PM/SGDN OU=DCSSI -# Subject: CN=IGC/A O=PM/SGDN OU=DCSSI -# Label: "IGC/A" -# Serial: 245102874772 -# MD5 Fingerprint: 0c:7f:dd:6a:f4:2a:b9:c8:9b:bd:20:7e:a9:db:5c:37 -# SHA1 Fingerprint: 60:d6:89:74:b5:c2:65:9e:8a:0f:c1:88:7c:88:d2:46:69:1b:18:2c -# SHA256 Fingerprint: b9:be:a7:86:0a:96:2e:a3:61:1d:ab:97:ab:6d:a3:e2:1c:10:68:b9:7d:55:57:5e:d0:e1:12:79:c1:1c:89:32 ------BEGIN CERTIFICATE----- -MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYT -AkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQ -TS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG -9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMB4XDTAyMTIxMzE0MjkyM1oXDTIw -MTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAM -BgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEO -MAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2 -LmZyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaI -s9z4iPf930Pfeo2aSVz2TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2 -xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCWSo7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4 -u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYyHF2fYPepraX/z9E0+X1b -F8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNdfrGoRpAx -Vs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGd -PDPQtQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNV -HSAEDjAMMAoGCCqBegF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAx -NjAfBgNVHSMEGDAWgBSjBS8YYFDCiQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUF -AAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RKq89toB9RlPhJy3Q2FLwV3duJ -L92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3QMZsyK10XZZOY -YLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg -Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2a -NjSaTFR+FwNIlQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R -0982gaEbeC9xs/FZTEYYKKuF0mBWWg== ------END CERTIFICATE----- - # Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1 # Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1 # Label: "Security Communication EV RootCA1" @@ -2047,48 +2015,6 @@ h7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk LY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho -----END CERTIFICATE----- -# Issuer: CN=EBG Elektronik Sertifika Hizmet Sağlayıcısı O=EBG Bilişim Teknolojileri ve Hizmetleri A.Ş. -# Subject: CN=EBG Elektronik Sertifika Hizmet Sağlayıcısı O=EBG Bilişim Teknolojileri ve Hizmetleri A.Ş. -# Label: "EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1" -# Serial: 5525761995591021570 -# MD5 Fingerprint: 2c:20:26:9d:cb:1a:4a:00:85:b5:b7:5a:ae:c2:01:37 -# SHA1 Fingerprint: 8c:96:ba:eb:dd:2b:07:07:48:ee:30:32:66:a0:f3:98:6e:7c:ae:58 -# SHA256 Fingerprint: 35:ae:5b:dd:d8:f7:ae:63:5c:ff:ba:56:82:a8:f0:0b:95:f4:84:62:c7:10:8e:e9:a0:e5:29:2b:07:4a:af:b2 ------BEGIN CERTIFICATE----- -MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV -BAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx -c8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt -ZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4 -MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg -SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl -a25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi -MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h -4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk -tiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s -tPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL -dlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4 -c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um -TDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z -+kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O -Lna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW -OeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW -fo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2 -l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB -/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw -FoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+ -8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI -6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO -TLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME -wfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY -Iai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn -xk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q -DgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q -Kd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t -hie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4 -7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7 -QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT ------END CERTIFICATE----- - # Issuer: O=certSIGN OU=certSIGN ROOT CA # Subject: O=certSIGN OU=certSIGN ROOT CA # Label: "certSIGN ROOT CA" @@ -2427,43 +2353,6 @@ Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ== -----END CERTIFICATE----- -# Issuer: CN=Juur-SK O=AS Sertifitseerimiskeskus -# Subject: CN=Juur-SK O=AS Sertifitseerimiskeskus -# Label: "Juur-SK" -# Serial: 999181308 -# MD5 Fingerprint: aa:8e:5d:d9:f8:db:0a:58:b7:8d:26:87:6c:82:35:55 -# SHA1 Fingerprint: 40:9d:4b:d9:17:b5:5c:27:b6:9b:64:cb:98:22:44:0d:cd:09:b8:89 -# SHA256 Fingerprint: ec:c3:e9:c3:40:75:03:be:e0:91:aa:95:2f:41:34:8f:f8:8b:aa:86:3b:22:64:be:fa:c8:07:90:15:74:e9:39 ------BEGIN CERTIFICATE----- -MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN -AQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp -dHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw -MVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw -CQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ -MA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -AIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB -SvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz -ABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH -LCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP -PbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL -2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w -ggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC -MIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk -AGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0 -AHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz -AGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz -AGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f -BCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE -FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY -P2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi -CfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g -kcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95 -HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS -na9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q -qIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z -TbvGRNs2yyqcjg== ------END CERTIFICATE----- - # Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post # Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post # Label: "Hongkong Post Root CA 1" From 966a448a55fa64a5c4654b8cd9656b79cc4b5ba8 Mon Sep 17 00:00:00 2001 From: Dan Born Date: Mon, 26 Sep 2016 15:51:42 -0700 Subject: [PATCH 018/123] Require non-NULL exec_ctx to unref. --- src/core/lib/iomgr/tcp_server.h | 4 ++-- src/core/lib/iomgr/tcp_server_posix.c | 11 ----------- src/core/lib/iomgr/tcp_server_windows.c | 19 +++++++------------ 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/core/lib/iomgr/tcp_server.h b/src/core/lib/iomgr/tcp_server.h index 5a25d39a0c4..9a390699b45 100644 --- a/src/core/lib/iomgr/tcp_server.h +++ b/src/core/lib/iomgr/tcp_server.h @@ -101,8 +101,8 @@ grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s); void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s, grpc_closure *shutdown_starting); -/* If the refcount drops to zero, delete s, and call (exec_ctx==NULL) or enqueue - a call (exec_ctx!=NULL) to shutdown_complete. */ +/* If the refcount drops to zero, enqueue calls on exec_ctx to + shutdown_listeners and delete s. */ void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s); /* Shutdown the fds of listeners. */ diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c index 5f846c8afb1..73df5477e66 100644 --- a/src/core/lib/iomgr/tcp_server_posix.c +++ b/src/core/lib/iomgr/tcp_server_posix.c @@ -745,22 +745,11 @@ void grpc_tcp_server_shutdown_starting_add(grpc_tcp_server *s, void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { if (gpr_unref(&s->refs)) { - grpc_exec_ctx local_exec_ctx = GRPC_EXEC_CTX_INIT; - bool finish_ctx = false; - /* FIXME: API allows a NULL exec_ctx, although this might cause us to delete - ourself before some enqueued work in some other exec_ctx runs. */ - if (exec_ctx == NULL) { - exec_ctx = &local_exec_ctx; - finish_ctx = true; - } grpc_tcp_server_shutdown_listeners(exec_ctx, s); gpr_mu_lock(&s->mu); grpc_exec_ctx_enqueue_list(exec_ctx, &s->shutdown_starting, NULL); gpr_mu_unlock(&s->mu); tcp_server_destroy(exec_ctx, s); - if (finish_ctx) { - grpc_exec_ctx_finish(exec_ctx); - } } } diff --git a/src/core/lib/iomgr/tcp_server_windows.c b/src/core/lib/iomgr/tcp_server_windows.c index 1b125e7005b..35faded993d 100644 --- a/src/core/lib/iomgr/tcp_server_windows.c +++ b/src/core/lib/iomgr/tcp_server_windows.c @@ -121,6 +121,9 @@ grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete, } static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { + gpr_mu_lock(&s->mu); + GPR_ASSERT(s->shutdown); + gpr_mu_unlock(&s->mu); if (s->shutdown_complete != NULL) { grpc_exec_ctx_sched(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE, NULL); } @@ -139,7 +142,7 @@ static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { } grpc_tcp_server *grpc_tcp_server_ref(grpc_tcp_server *s) { - gpr_ref(&s->refs); + gpr_ref_non_zero(&s->refs); return s; } @@ -174,19 +177,11 @@ static void tcp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { void grpc_tcp_server_unref(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { if (gpr_unref(&s->refs)) { - /* Complete shutdown_starting work before destroying. */ - grpc_exec_ctx local_exec_ctx = GRPC_EXEC_CTX_INIT; + grpc_tcp_server_shutdown_listeners(exec_ctx, s); gpr_mu_lock(&s->mu); - grpc_exec_ctx_enqueue_list(&local_exec_ctx, &s->shutdown_starting, NULL); + grpc_exec_ctx_enqueue_list(exec_ctx, &s->shutdown_starting, NULL); gpr_mu_unlock(&s->mu); - if (exec_ctx == NULL) { - grpc_exec_ctx_flush(&local_exec_ctx); - tcp_server_destroy(&local_exec_ctx, s); - grpc_exec_ctx_finish(&local_exec_ctx); - } else { - grpc_exec_ctx_finish(&local_exec_ctx); - tcp_server_destroy(exec_ctx, s); - } + tcp_server_destroy(exec_ctx, s); } } From 94777240032e41dd0cfb56218a09912395aded05 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 27 Sep 2016 13:07:00 -0700 Subject: [PATCH 019/123] Change C++ API to expose wait_for_ready instead of fail_fast. --- include/grpc++/impl/codegen/client_context.h | 13 +++++++++---- src/cpp/client/client_context.cc | 2 +- test/cpp/end2end/client_crash_test.cc | 4 ++-- test/cpp/end2end/hybrid_end2end_test.cc | 10 +++++----- test/cpp/end2end/server_crash_test_client.cc | 2 +- test/cpp/qps/driver.cc | 6 +++--- 6 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index 387d807c4b2..faabddecc3c 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -226,8 +226,13 @@ class ClientContext { /// EXPERIMENTAL: Set this request to be cacheable void set_cacheable(bool cacheable) { cacheable_ = cacheable; } - /// EXPERIMENTAL: Trigger fail-fast or not on this request - void set_fail_fast(bool fail_fast) { fail_fast_ = fail_fast; } + /// EXPERIMENTAL: Trigger wait-for-ready or not on this request + void set_wait_for_ready(bool wait_for_ready) { + wait_for_ready_ = wait_for_ready; + } + + /// DEPRECATED: Use set_wait_for_ready() instead. + void set_fail_fast(bool fail_fast) { wait_for_ready_ = !fail_fast; } #ifndef GRPC_CXX0X_NO_CHRONO /// Return the deadline for the client call. @@ -347,14 +352,14 @@ class ClientContext { uint32_t initial_metadata_flags() const { return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) | - (fail_fast_ ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY) | + (wait_for_ready_ ? GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY : 0) | (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0); } grpc::string authority() { return authority_; } bool initial_metadata_received_; - bool fail_fast_; + bool wait_for_ready_; bool idempotent_; bool cacheable_; std::shared_ptr channel_; diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index 5b6aaa777bc..fb9a7c0459e 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -59,7 +59,7 @@ static ClientContext::GlobalCallbacks* g_client_callbacks = ClientContext::ClientContext() : initial_metadata_received_(false), - fail_fast_(true), + wait_for_ready_(false), idempotent_(false), cacheable_(false), call_(nullptr), diff --git a/test/cpp/end2end/client_crash_test.cc b/test/cpp/end2end/client_crash_test.cc index c452ad2beb4..966c04b0e3e 100644 --- a/test/cpp/end2end/client_crash_test.cc +++ b/test/cpp/end2end/client_crash_test.cc @@ -89,7 +89,7 @@ TEST_F(CrashTest, KillBeforeWrite) { EchoRequest request; EchoResponse response; ClientContext context; - context.set_fail_fast(false); + context.set_wait_for_ready(true); auto stream = stub->BidiStream(&context); @@ -115,7 +115,7 @@ TEST_F(CrashTest, KillAfterWrite) { EchoRequest request; EchoResponse response; ClientContext context; - context.set_fail_fast(false); + context.set_wait_for_ready(true); auto stream = stub->BidiStream(&context); diff --git a/test/cpp/end2end/hybrid_end2end_test.cc b/test/cpp/end2end/hybrid_end2end_test.cc index 82361d0e90d..8cd2e663470 100644 --- a/test/cpp/end2end/hybrid_end2end_test.cc +++ b/test/cpp/end2end/hybrid_end2end_test.cc @@ -261,7 +261,7 @@ class HybridEnd2endTest : public ::testing::Test { EchoRequest send_request; EchoResponse recv_response; ClientContext cli_ctx; - cli_ctx.set_fail_fast(false); + cli_ctx.set_wait_for_ready(true); send_request.set_message("Hello"); Status recv_status = stub_->Echo(&cli_ctx, send_request, &recv_response); EXPECT_EQ(send_request.message(), recv_response.message()); @@ -275,7 +275,7 @@ class HybridEnd2endTest : public ::testing::Test { EchoRequest send_request; EchoResponse recv_response; ClientContext cli_ctx; - cli_ctx.set_fail_fast(false); + cli_ctx.set_wait_for_ready(true); send_request.set_message("Hello"); Status recv_status = stub->Echo(&cli_ctx, send_request, &recv_response); EXPECT_EQ(send_request.message() + "_dup", recv_response.message()); @@ -287,7 +287,7 @@ class HybridEnd2endTest : public ::testing::Test { EchoResponse recv_response; grpc::string expected_message; ClientContext cli_ctx; - cli_ctx.set_fail_fast(false); + cli_ctx.set_wait_for_ready(true); send_request.set_message("Hello"); auto stream = stub_->RequestStream(&cli_ctx, &recv_response); for (int i = 0; i < 5; i++) { @@ -304,7 +304,7 @@ class HybridEnd2endTest : public ::testing::Test { EchoRequest request; EchoResponse response; ClientContext context; - context.set_fail_fast(false); + context.set_wait_for_ready(true); request.set_message("hello"); auto stream = stub_->ResponseStream(&context, request); @@ -324,7 +324,7 @@ class HybridEnd2endTest : public ::testing::Test { EchoRequest request; EchoResponse response; ClientContext context; - context.set_fail_fast(false); + context.set_wait_for_ready(true); grpc::string msg("hello"); auto stream = stub_->BidiStream(&context); diff --git a/test/cpp/end2end/server_crash_test_client.cc b/test/cpp/end2end/server_crash_test_client.cc index 10a251c952f..5df09cd8536 100644 --- a/test/cpp/end2end/server_crash_test_client.cc +++ b/test/cpp/end2end/server_crash_test_client.cc @@ -65,7 +65,7 @@ int main(int argc, char** argv) { EchoRequest request; EchoResponse response; grpc::ClientContext context; - context.set_fail_fast(false); + context.set_wait_for_ready(true); if (FLAGS_mode == "bidi") { auto stream = stub->BidiStream(&context); diff --git a/test/cpp/qps/driver.cc b/test/cpp/qps/driver.cc index b4c18bcb46e..7460bb526ac 100644 --- a/test/cpp/qps/driver.cc +++ b/test/cpp/qps/driver.cc @@ -83,7 +83,7 @@ static std::unordered_map> get_hosts_and_cores( auto stub = WorkerService::NewStub( CreateChannel(*it, InsecureChannelCredentials())); grpc::ClientContext ctx; - ctx.set_fail_fast(false); + ctx.set_wait_for_ready(true); CoreRequest dummy; CoreResponse cores; grpc::Status s = stub->CoreCount(&ctx, dummy, &cores); @@ -167,7 +167,7 @@ namespace runsc { static ClientContext* AllocContext(list* contexts) { contexts->emplace_back(); auto context = &contexts->back(); - context->set_fail_fast(false); + context->set_wait_for_ready(true); return context; } @@ -527,7 +527,7 @@ bool RunQuit() { CreateChannel(workers[i], InsecureChannelCredentials())); Void dummy; grpc::ClientContext ctx; - ctx.set_fail_fast(false); + ctx.set_wait_for_ready(true); Status s = stub->QuitWorker(&ctx, dummy, &dummy); if (!s.ok()) { gpr_log(GPR_ERROR, "Worker %zu could not be properly quit because %s", i, From e8b87865b268856d5510abb6ffd044224c079c13 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 27 Sep 2016 13:16:18 -0700 Subject: [PATCH 020/123] Add doc of pending API cleanups for C++. --- doc/cpp/pending_api_cleanups.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/cpp/pending_api_cleanups.md diff --git a/doc/cpp/pending_api_cleanups.md b/doc/cpp/pending_api_cleanups.md new file mode 100644 index 00000000000..3e77b657c62 --- /dev/null +++ b/doc/cpp/pending_api_cleanups.md @@ -0,0 +1,15 @@ +There are times when we make changes that include a temporary shim for +backward-compatibility (e.g., a macro or some other function to preserve +the original API) to avoid having to bump the major version number in +the next release. However, when we do eventually want to release a +feature that does change the API in a non-backward-compatible way, we +will wind up bumping the major version number anyway, at which point we +can take the opportunity to clean up any pending backward-compatibility +shims. + +This file lists all pending backward-compatibility changes that should +be cleaned up the next time we are going to bump the major version +number: + +- remove `ClientContext::set_fail_fast()` method from + `include/grpc++/impl/codegen/client_context.h` (commit `9477724`) From e529ea392824db09887f62cc00bbb46329a77003 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 27 Sep 2016 16:18:11 -0700 Subject: [PATCH 021/123] Rename variables --- test/cpp/util/proto_reflection_descriptor_database.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index ae633ea7f4e..82d82a348d1 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -317,13 +317,13 @@ ProtoReflectionDescriptorDatabase::GetStream() { bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { - bool request_succeed = false; + bool request_success = false; stream_mutex_.lock(); if (GetStream()->Write(request) && GetStream()->Read(&response)) { - request_succeed = true; + request_success = true; } stream_mutex_.unlock(); - return request_succeed; + return request_success; } } // namespace grpc From 15bc4627de675cc148989977e1f6afd3ea3c6755 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Tue, 27 Sep 2016 16:22:35 -0700 Subject: [PATCH 022/123] Rename variables ... again --- test/cpp/util/proto_reflection_descriptor_database.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index 82d82a348d1..409b0de1b20 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -317,13 +317,13 @@ ProtoReflectionDescriptorDatabase::GetStream() { bool ProtoReflectionDescriptorDatabase::DoOneRequest( const ServerReflectionRequest& request, ServerReflectionResponse& response) { - bool request_success = false; + bool success = false; stream_mutex_.lock(); if (GetStream()->Write(request) && GetStream()->Read(&response)) { - request_success = true; + success = true; } stream_mutex_.unlock(); - return request_success; + return success; } } // namespace grpc From 16c26ed252fa5a186db6e93248325b0f918c8625 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 26 Sep 2016 17:22:03 -0700 Subject: [PATCH 023/123] Add support of PUT method --- .../cronet/transport/cronet_transport.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 366690acf2b..6c2b53f2917 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -531,7 +531,8 @@ static void create_grpc_frame(gpr_slice_buffer *write_slice_buffer, */ static void convert_metadata_to_cronet_headers( grpc_linked_mdelem *head, const char *host, char **pp_url, - cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers) { + cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers, + const char ** method) { grpc_linked_mdelem *curr = head; /* Walk the linked list and get number of header fields */ size_t num_headers_available = 0; @@ -558,11 +559,20 @@ static void convert_metadata_to_cronet_headers( curr = curr->next; const char *key = grpc_mdstr_as_c_string(mdelem->key); const char *value = grpc_mdstr_as_c_string(mdelem->value); - if (mdelem->key == GRPC_MDSTR_METHOD || mdelem->key == GRPC_MDSTR_SCHEME || + if (mdelem->key == GRPC_MDSTR_SCHEME || mdelem->key == GRPC_MDSTR_AUTHORITY) { /* Cronet populates these fields on its own */ continue; } + if (mdelem->key == GRPC_MDSTR_METHOD) { + if (mdelem->value == GRPC_MDSTR_PUT) { + *method = grpc_static_metadata_strings[74]; + } else { + /* POST method in default*/ + *method = grpc_static_metadata_strings[71]; + } + continue; + } if (mdelem->key == GRPC_MDSTR_PATH) { /* Create URL by appending :path value to the hostname */ gpr_asprintf(pp_url, "https://%s%s", host, value); @@ -760,14 +770,15 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, &cronet_callbacks); CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs); char *url; + const char *method; s->header_array.headers = NULL; convert_metadata_to_cronet_headers( stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url, - &s->header_array.headers, &s->header_array.count); + &s->header_array.headers, &s->header_array.count, &method); s->header_array.capacity = s->header_array.count; CRONET_LOG(GPR_DEBUG, "cronet_bidirectional_stream_start(%p, %s)", s->cbs, url); - cronet_bidirectional_stream_start(s->cbs, url, 0, "POST", &s->header_array, + cronet_bidirectional_stream_start(s->cbs, url, 0, method, &s->header_array, false); stream_state->state_op_done[OP_SEND_INITIAL_METADATA] = true; result = ACTION_TAKEN_WITH_CALLBACK; From fdea83d42afbebfecfea1edf9143619640115824 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 27 Sep 2016 16:11:18 -0700 Subject: [PATCH 024/123] Update grpc objc API for support of PUT method --- src/objective-c/GRPCClient/GRPCCall.h | 7 ++++++- src/objective-c/GRPCClient/GRPCCall.m | 14 ++++++++++++-- .../GRPCClient/private/GRPCWrappedCall.h | 4 ++++ .../GRPCClient/private/GRPCWrappedCall.m | 14 ++++++++++++-- src/objective-c/ProtoRPC/ProtoRPC.h | 3 ++- src/objective-c/ProtoRPC/ProtoRPC.m | 9 ++++++--- src/objective-c/ProtoRPC/ProtoService.h | 3 ++- src/objective-c/ProtoRPC/ProtoService.m | 6 ++++-- 8 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index b9e741dfa8f..fc59e5f5e91 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -225,7 +225,12 @@ extern id const kGRPCTrailersKey; */ - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestsWriter NS_DESIGNATED_INITIALIZER; + requestsWriter:(GRXWriter *)requestsWriter; + +- (instancetype)initWithHost:(NSString *)host + path:(NSString *)path + requestsWriter:(GRXWriter *)requestsWriter + http2Method:(NSString *)http2Method NS_DESIGNATED_INITIALIZER; /** * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index eecda4c03a0..6bd80c8b3fe 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -75,6 +75,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; NSString *_host; NSString *_path; + NSString *_http2Method; GRPCWrappedCall *_wrappedCall; GRPCConnectivityMonitor *_connectivityMonitor; @@ -109,13 +110,20 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; } - (instancetype)init { - return [self initWithHost:nil path:nil requestsWriter:nil]; + return [self initWithHost:nil path:nil requestsWriter:nil http2Method:nil]; +} + +- (instancetype)initWithHost:(NSString *)host + path:(NSString *)path + requestsWriter:(GRXWriter *)requestWriter{ + return [self initWithHost:host path:path requestsWriter:requestWriter http2Method:@"POST"]; } // Designated initializer - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestWriter { + requestsWriter:(GRXWriter *)requestWriter + http2Method:(NSString *)http2Method { if (!host || !path) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; } @@ -126,6 +134,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; if ((self = [super init])) { _host = [host copy]; _path = [path copy]; + _http2Method = http2Method; // Serial queue to invoke the non-reentrant methods of the grpc_call object. _callQueue = dispatch_queue_create("io.grpc.call", NULL); @@ -231,6 +240,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; - (void)sendHeaders:(NSDictionary *)headers { // TODO(jcanizales): Add error handlers for async failures [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendMetadata alloc] initWithMetadata:headers + http2Method:_http2Method handler:nil]]]; } diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h index e37ed1b59fb..8b64b27e567 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h @@ -45,6 +45,10 @@ @interface GRPCOpSendMetadata : GRPCOperation - (instancetype)initWithMetadata:(NSDictionary *)metadata + handler:(void(^)())handler; + +- (instancetype)initWithMetadata:(NSDictionary *)metadata + http2Method:(NSString *)http2Method handler:(void(^)())handler NS_DESIGNATED_INITIALIZER; @end diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 13394296609..2836f99bf17 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -64,16 +64,26 @@ @implementation GRPCOpSendMetadata - (instancetype)init { - return [self initWithMetadata:nil handler:nil]; + return [self initWithMetadata:nil http2Method:nil handler:nil]; } -- (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)())handler { +- (instancetype)initWithMetadata:(NSDictionary *)metadata + handler:(void (^)())handler { + return [self initWithMetadata:metadata http2Method:@"POST" handler:handler]; +} + +- (instancetype)initWithMetadata:(NSDictionary *)metadata + http2Method:(NSString *)http2Method + handler:(void (^)())handler { if (self = [super init]) { _op.op = GRPC_OP_SEND_INITIAL_METADATA; _op.data.send_initial_metadata.count = metadata.count; _op.data.send_initial_metadata.metadata = metadata.grpc_metadataArray; _op.data.send_initial_metadata.maybe_compression_level.is_set = false; _op.data.send_initial_metadata.maybe_compression_level.level = 0; + if ([http2Method isEqualToString:@"PUT"]) { + _op.flags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST; + } _handler = handler; } return self; diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index 04fc1e45f16..509a15abae8 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -47,7 +47,8 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) method:(GRPCProtoMethod *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable NS_DESIGNATED_INITIALIZER; + responsesWriteable:(id)responsesWriteable + http2Method:(NSString *)http2Method NS_DESIGNATED_INITIALIZER; - (void)start; @end diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 83d1b655e8d..67405d2a196 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -65,7 +65,8 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing #pragma clang diagnostic ignored "-Wobjc-designated-initializers" - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestsWriter { + requestsWriter:(GRXWriter *)requestsWriter + http2Method:(NSString *)http2Method { [NSException raise:NSInvalidArgumentException format:@"Please use ProtoRPC's designated initializer instead."]; return nil; @@ -77,7 +78,8 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing method:(GRPCProtoMethod *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable { + responsesWriteable:(id)responsesWriteable + http2Method:(NSString *)http2Method { // Because we can't tell the type system to constrain the class, we need to check at runtime: if (![responseClass respondsToSelector:@selector(parseFromData:error:)]) { [NSException raise:NSInvalidArgumentException @@ -91,7 +93,8 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing } return [proto data]; }]; - if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter])) { + if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter + http2Method:http2Method])) { __weak ProtoRPC *weakSelf = self; // A writeable that parses the proto messages received. diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 7faae1b49c9..80fab37fd55 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -47,7 +47,8 @@ __attribute__((deprecated("Please use GRPCProtoService."))) - (GRPCProtoCall *)RPCToMethod:(NSString *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable; + responsesWriteable:(id)responsesWriteable + http2Method:(NSString *)http2Method; @end diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index 3487fac59d3..fc3e0170728 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -68,7 +68,8 @@ - (GRPCProtoCall *)RPCToMethod:(NSString *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable { + responsesWriteable:(id)responsesWriteable + http2Method:(NSString *)http2Method { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; @@ -76,7 +77,8 @@ method:methodName requestsWriter:requestsWriter responseClass:responseClass - responsesWriteable:responsesWriteable]; + responsesWriteable:responsesWriteable + http2Method:http2Method]; } @end From 42511cfd8b7c56c176c819311ea4dd4ade4df960 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Tue, 27 Sep 2016 18:15:54 -0700 Subject: [PATCH 025/123] Addressed review feedback 1. modified documentation 2. changed test slightly to make it more robust to accidental cache hits --- doc/interop-test-descriptions.md | 27 +++++++++++++++++++-------- test/cpp/interop/interop_client.cc | 9 +++++---- test/cpp/interop/interop_server.cc | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 5b3ad2335cc..e3a41b12958 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -65,21 +65,21 @@ ensure that the proto serialized to zero bytes.* This test verifies that gRPC requests marked as cacheable use GET verb instead of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind -a caching proxy. It is NOT expected to pass if client is accessing the server -directly. +a caching proxy. Use of current timestamp in the request prevents accidental +cache matches left over from previous tests. Server features: * [CacheableUnaryCall][] Procedure: - 1. Client calls CacheableUnaryCall twice, and compares the two responses. - The server generates a unique response (timestamp) for each request. - If the second response was delivered from cache, then both responses will - be the same. + 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload + set to current timestamp. + 2. Client calls CacheableUnaryCall with `SimpleRequest` request again + immediately with the same payload as the previous request. Client asserts: -* call was successful -* responses are the same. +* Both calls were successful +* The payload body of both responses is the same. ### large_unary @@ -962,6 +962,17 @@ payload body of size `SimpleRequest.response_size` bytes and type as appropriate for the `SimpleRequest.response_type`. If the server does not support the `response_type`, then it should fail the RPC with `INVALID_ARGUMENT`. +### CacheableUnaryCall + +Server gets the default Empty proto as the request. It returns the +SimpleResponse proto with the payload set to current timestamp string. +In addition it adds + 1. cache control headers such that the response can be cached by proxies in + the response path. Server should be behind a caching proxy for this test + to pass. + 2. adds a `x-user-ip` header with `1.2.3.4` to the response. This is done + since some proxys such as GFE will not cache requests from localhost. + ### CompressedResponse [CompressedResponse]: #compressedresponse diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index f2290adfc3b..49ecf2620e2 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -848,10 +848,11 @@ bool InteropClient::DoStatusWithMessage() { bool InteropClient::DoCacheableUnary() { gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); + // Create request with current timestamp + gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + std::string timestamp = std::to_string(ts.tv_nsec); SimpleRequest request; - request.set_response_size(16); - grpc::string payload(16, '\0'); - request.mutable_payload()->set_body(payload.c_str(), 16); + request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); // Request 1 ClientContext context1; @@ -878,7 +879,7 @@ bool InteropClient::DoCacheableUnary() { if (!AssertStatusOk(s2)) { return false; } - gpr_log(GPR_DEBUG, "response 1 payload: %s", + gpr_log(GPR_DEBUG, "response 2 payload: %s", response2.payload().body().c_str()); // Check that the body is same for both requests. It will be the same if the diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index ac2567eba02..64eec4241af 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -159,7 +159,7 @@ class TestServiceImpl : public TestService::Service { gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); - context->AddInitialMetadata("Cache-Control", "max-age=100000, public"); + context->AddInitialMetadata("cache-control", "max-age=100000, public"); return Status::OK; } From a04c6789632c1e454cfe563f3144c27498d5ef0a Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 08:43:00 -0700 Subject: [PATCH 026/123] trivial doc fix. --- doc/interop-test-descriptions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index e3a41b12958..8a1e93eee02 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -964,9 +964,9 @@ for the `SimpleRequest.response_type`. If the server does not support the ### CacheableUnaryCall -Server gets the default Empty proto as the request. It returns the -SimpleResponse proto with the payload set to current timestamp string. -In addition it adds +Server gets the default SimpleRequest proto as the request. The content of the +request are ignored. It returns the SimpleResponse proto with the payload set +to current timestamp string. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test to pass. From 012fc18be93b98967a20986469eada34eac0c061 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 10:46:27 -0700 Subject: [PATCH 027/123] doc fixes and max-age set to 60 --- doc/interop-test-descriptions.md | 15 +++++++++------ test/cpp/interop/interop_server.cc | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 8a1e93eee02..62d36708f93 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -67,13 +67,17 @@ of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. +Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. +This is done since some proxys such as GFE will not cache requests from +localhost. Server features: * [CacheableUnaryCall][] Procedure: 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload - set to current timestamp. + set to current timestamp. Timestamp format is irrelevant, and resolution is + in nanoseconds. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again immediately with the same payload as the previous request. @@ -965,13 +969,12 @@ for the `SimpleRequest.response_type`. If the server does not support the ### CacheableUnaryCall Server gets the default SimpleRequest proto as the request. The content of the -request are ignored. It returns the SimpleResponse proto with the payload set -to current timestamp string. In addition it adds +request is ignored. It returns the SimpleResponse proto with the payload set +to current timestamp. The timestamp is an integer representing current time +with nanosecond resolution. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test - to pass. - 2. adds a `x-user-ip` header with `1.2.3.4` to the response. This is done - since some proxys such as GFE will not cache requests from localhost. + to pass. Currently we set the max-age to 60 seconds. ### CompressedResponse [CompressedResponse]: #compressedresponse diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 64eec4241af..06d1bdb7965 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -159,7 +159,7 @@ class TestServiceImpl : public TestService::Service { gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); - context->AddInitialMetadata("cache-control", "max-age=100000, public"); + context->AddInitialMetadata("cache-control", "max-age=60, public"); return Status::OK; } From ed3e86b7d907c0d09ce70d794cb964c5a4a2a53e Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 10:55:49 -0700 Subject: [PATCH 028/123] added comment about setting cacheable flag. --- doc/interop-test-descriptions.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 62d36708f93..19947b3c60d 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -70,6 +70,10 @@ cache matches left over from previous tests. Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. This is done since some proxys such as GFE will not cache requests from localhost. +Note also that the client request needs to marked as cacheable. For now this is +achieved by setting the cacheable flag in the request context to 'true'.Longer +term this will be automatically set via method options specified in the proto +file. Server features: * [CacheableUnaryCall][] From 1bb6e68fde7266c0ff626b4d0fcc735d1710d9c0 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 11:16:15 -0700 Subject: [PATCH 029/123] more doc fixes --- doc/interop-test-descriptions.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 19947b3c60d..92824df23d6 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -67,13 +67,6 @@ of POST, and that server sets appropriate cache control headers for the response to be cached by a proxy. This interop test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. -Note that client adds a `x-user-ip` header with value `1.2.3.4` to the request. -This is done since some proxys such as GFE will not cache requests from -localhost. -Note also that the client request needs to marked as cacheable. For now this is -achieved by setting the cacheable flag in the request context to 'true'.Longer -term this will be automatically set via method options specified in the proto -file. Server features: * [CacheableUnaryCall][] @@ -82,8 +75,15 @@ Procedure: 1. Client calls CacheableUnaryCall with `SimpleRequest` request with payload set to current timestamp. Timestamp format is irrelevant, and resolution is in nanoseconds. + Client adds a `x-user-ip` header with value `1.2.3.4` to the request. + This is done since some proxys such as GFE will not cache requests from + localhost. + Client marks the request as cacheable by setting the cacheable flag in the + request context. Longer term this should be driven by the method option + specified in the proto file itself. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again - immediately with the same payload as the previous request. + immediately with the same payload as the previous request. Cacheable flat is + also set for this request's context. Client asserts: * Both calls were successful @@ -975,7 +975,9 @@ for the `SimpleRequest.response_type`. If the server does not support the Server gets the default SimpleRequest proto as the request. The content of the request is ignored. It returns the SimpleResponse proto with the payload set to current timestamp. The timestamp is an integer representing current time -with nanosecond resolution. In addition it adds +with nanosecond resolution. This integer is formated as ASCII decimal in the +response. The format is not really important as long as the response payload +is different for each request. In addition it adds 1. cache control headers such that the response can be cached by proxies in the response path. Server should be behind a caching proxy for this test to pass. Currently we set the max-age to 60 seconds. From e97f7c0ba6c2f7c55e2ea650f52597a06bcfa6fd Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 28 Sep 2016 11:25:57 -0700 Subject: [PATCH 030/123] Allow more general flags to be passed to ObjC API --- src/objective-c/GRPCClient/GRPCCall.h | 2 +- src/objective-c/GRPCClient/GRPCCall.m | 12 ++++++------ src/objective-c/GRPCClient/private/GRPCWrappedCall.h | 2 +- src/objective-c/GRPCClient/private/GRPCWrappedCall.m | 10 ++++------ src/objective-c/ProtoRPC/ProtoRPC.h | 2 +- src/objective-c/ProtoRPC/ProtoRPC.m | 6 +++--- src/objective-c/ProtoRPC/ProtoService.h | 2 +- src/objective-c/ProtoRPC/ProtoService.m | 4 ++-- 8 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index fc59e5f5e91..9a58311fe16 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -230,7 +230,7 @@ extern id const kGRPCTrailersKey; - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestsWriter - http2Method:(NSString *)http2Method NS_DESIGNATED_INITIALIZER; + flags:(uint32_t)flags NS_DESIGNATED_INITIALIZER; /** * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 6bd80c8b3fe..8a58db70514 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -75,7 +75,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; NSString *_host; NSString *_path; - NSString *_http2Method; + uint32_t _flags; GRPCWrappedCall *_wrappedCall; GRPCConnectivityMonitor *_connectivityMonitor; @@ -110,20 +110,20 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; } - (instancetype)init { - return [self initWithHost:nil path:nil requestsWriter:nil http2Method:nil]; + return [self initWithHost:nil path:nil requestsWriter:nil flags:0]; } - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestWriter{ - return [self initWithHost:host path:path requestsWriter:requestWriter http2Method:@"POST"]; + return [self initWithHost:host path:path requestsWriter:requestWriter flags:0]; } // Designated initializer - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestWriter - http2Method:(NSString *)http2Method { + flags:(uint32_t)flags { if (!host || !path) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; } @@ -134,7 +134,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; if ((self = [super init])) { _host = [host copy]; _path = [path copy]; - _http2Method = http2Method; + _flags = flags; // Serial queue to invoke the non-reentrant methods of the grpc_call object. _callQueue = dispatch_queue_create("io.grpc.call", NULL); @@ -240,7 +240,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; - (void)sendHeaders:(NSDictionary *)headers { // TODO(jcanizales): Add error handlers for async failures [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendMetadata alloc] initWithMetadata:headers - http2Method:_http2Method + flags:_flags handler:nil]]]; } diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h index 8b64b27e567..52233c82420 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.h +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.h @@ -48,7 +48,7 @@ handler:(void(^)())handler; - (instancetype)initWithMetadata:(NSDictionary *)metadata - http2Method:(NSString *)http2Method + flags:(uint32_t)flags handler:(void(^)())handler NS_DESIGNATED_INITIALIZER; @end diff --git a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m index 2836f99bf17..627b6aa86dd 100644 --- a/src/objective-c/GRPCClient/private/GRPCWrappedCall.m +++ b/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @@ -64,16 +64,16 @@ @implementation GRPCOpSendMetadata - (instancetype)init { - return [self initWithMetadata:nil http2Method:nil handler:nil]; + return [self initWithMetadata:nil flags:0 handler:nil]; } - (instancetype)initWithMetadata:(NSDictionary *)metadata handler:(void (^)())handler { - return [self initWithMetadata:metadata http2Method:@"POST" handler:handler]; + return [self initWithMetadata:metadata flags:0 handler:handler]; } - (instancetype)initWithMetadata:(NSDictionary *)metadata - http2Method:(NSString *)http2Method + flags:(uint32_t)flags handler:(void (^)())handler { if (self = [super init]) { _op.op = GRPC_OP_SEND_INITIAL_METADATA; @@ -81,9 +81,7 @@ _op.data.send_initial_metadata.metadata = metadata.grpc_metadataArray; _op.data.send_initial_metadata.maybe_compression_level.is_set = false; _op.data.send_initial_metadata.maybe_compression_level.level = 0; - if ([http2Method isEqualToString:@"PUT"]) { - _op.flags = GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST; - } + _op.flags = flags; _handler = handler; } return self; diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index 509a15abae8..75c9b9bb3bc 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -48,7 +48,7 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - http2Method:(NSString *)http2Method NS_DESIGNATED_INITIALIZER; + flags:(uint32_t)flags NS_DESIGNATED_INITIALIZER; - (void)start; @end diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 67405d2a196..2514d616f16 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -66,7 +66,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestsWriter - http2Method:(NSString *)http2Method { + flags:(uint32_t)flags { [NSException raise:NSInvalidArgumentException format:@"Please use ProtoRPC's designated initializer instead."]; return nil; @@ -79,7 +79,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - http2Method:(NSString *)http2Method { + flags:(uint32_t)flags { // Because we can't tell the type system to constrain the class, we need to check at runtime: if (![responseClass respondsToSelector:@selector(parseFromData:error:)]) { [NSException raise:NSInvalidArgumentException @@ -94,7 +94,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing return [proto data]; }]; if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter - http2Method:http2Method])) { + flags:flags])) { __weak ProtoRPC *weakSelf = self; // A writeable that parses the proto messages received. diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 80fab37fd55..9a49ebd257b 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -48,7 +48,7 @@ __attribute__((deprecated("Please use GRPCProtoService."))) requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - http2Method:(NSString *)http2Method; + flags:(uint32_t)flags; @end diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index fc3e0170728..b237164a006 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -69,7 +69,7 @@ requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - http2Method:(NSString *)http2Method { + flags:(uint32_t)flags { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; @@ -78,7 +78,7 @@ requestsWriter:requestsWriter responseClass:responseClass responsesWriteable:responsesWriteable - http2Method:http2Method]; + flags:flags]; } @end From d7aef05f24472977ee3a976d5321470132ec785c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 28 Sep 2016 12:05:30 -0700 Subject: [PATCH 031/123] Readability improvement --- src/core/ext/transport/cronet/transport/cronet_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 6c2b53f2917..6d5fe318ccb 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -566,10 +566,10 @@ static void convert_metadata_to_cronet_headers( } if (mdelem->key == GRPC_MDSTR_METHOD) { if (mdelem->value == GRPC_MDSTR_PUT) { - *method = grpc_static_metadata_strings[74]; + *method = (const char*)mdelem->value->slice.data.refcounted.bytes; } else { /* POST method in default*/ - *method = grpc_static_metadata_strings[71]; + *method = (const char*)(GRPC_MDSTR_POST->slice.data.refcounted.bytes); } continue; } From af564a1e920af86260a8003e20091c9eaa4e1c81 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 28 Sep 2016 12:50:37 -0700 Subject: [PATCH 032/123] changed timestamp clock from REALTIME to PRECISE to increase robustness --- test/cpp/interop/interop_client.cc | 2 +- test/cpp/interop/interop_server.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 49ecf2620e2..f323090ebf0 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -849,7 +849,7 @@ bool InteropClient::DoCacheableUnary() { gpr_log(GPR_DEBUG, "Sending RPC with cacheable response"); // Create request with current timestamp - gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string(ts.tv_nsec); SimpleRequest request; request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 06d1bdb7965..e5e62dfc1ae 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -156,7 +156,7 @@ class TestServiceImpl : public TestService::Service { // Response contains current timestamp. We ignore everything in the request. Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { - gpr_timespec ts = gpr_now(GPR_CLOCK_REALTIME); + gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string(ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); context->AddInitialMetadata("cache-control", "max-age=60, public"); From a4aebf873e485a39084bb003c6978b3306874bf7 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 28 Sep 2016 13:20:18 -0700 Subject: [PATCH 033/123] Remove unused inclusion --- test/cpp/util/grpc_tool.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cpp/util/grpc_tool.cc b/test/cpp/util/grpc_tool.cc index 8fb325cf76e..03c33abe9f5 100644 --- a/test/cpp/util/grpc_tool.cc +++ b/test/cpp/util/grpc_tool.cc @@ -52,7 +52,6 @@ #include "test/cpp/util/proto_file_parser.h" #include "test/cpp/util/proto_reflection_descriptor_database.h" #include "test/cpp/util/service_describer.h" -#include "test/cpp/util/test_config.h" namespace grpc { namespace testing { From 59c9f904bfe5a9cc7102b44c9440a5e93fdaf159 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 28 Sep 2016 13:33:21 -0700 Subject: [PATCH 034/123] Rename GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY to GRPC_INITIAL_METADATA_WAIT_FOR_READY. Also add a flag to indicate whether wait_for_ready was explicitly set by the application. --- include/grpc++/impl/codegen/client_context.h | 6 ++++-- include/grpc/impl/codegen/grpc_types.h | 13 ++++++++++--- src/core/ext/client_config/client_channel.c | 4 ++-- src/cpp/client/client_context.cc | 1 + 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index faabddecc3c..dd37e6a8503 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -229,10 +229,11 @@ class ClientContext { /// EXPERIMENTAL: Trigger wait-for-ready or not on this request void set_wait_for_ready(bool wait_for_ready) { wait_for_ready_ = wait_for_ready; + wait_for_ready_explicitly_set_ = true; } /// DEPRECATED: Use set_wait_for_ready() instead. - void set_fail_fast(bool fail_fast) { wait_for_ready_ = !fail_fast; } + void set_fail_fast(bool fail_fast) { set_wait_for_ready(!fail_fast); } #ifndef GRPC_CXX0X_NO_CHRONO /// Return the deadline for the client call. @@ -352,7 +353,7 @@ class ClientContext { uint32_t initial_metadata_flags() const { return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) | - (wait_for_ready_ ? GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY : 0) | + (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) | (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0); } @@ -360,6 +361,7 @@ class ClientContext { bool initial_metadata_received_; bool wait_for_ready_; + bool wait_for_ready_explicitly_set_; bool idempotent_; bool cacheable_; std::shared_ptr channel_; diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 191cdd0e5fb..e9da7e8b715 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -254,15 +254,22 @@ typedef enum grpc_call_error { /** Signal that the call is idempotent */ #define GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST (0x00000010u) /** Signal that the call should not return UNAVAILABLE before it has started */ -#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY (0x00000020u) +#define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u) +/** DEPRECATED: for backward compatibility */ +#define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY \ + GRPC_INITIAL_METADATA_WAIT_FOR_READY /** Signal that the call is cacheable. GRPC is free to use GET verb */ #define GRPC_INITIAL_METADATA_CACHEABLE_REQUEST (0x00000040u) +/** Signal that GRPC_INITIAL_METADATA_WAIT_FOR_READY was explicitly set + by the calling application. */ +#define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u) /** Mask of all valid flags */ #define GRPC_INITIAL_METADATA_USED_MASK \ (GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \ - GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY | \ - GRPC_INITIAL_METADATA_CACHEABLE_REQUEST) + GRPC_INITIAL_METADATA_WAIT_FOR_READY | \ + GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \ + GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET) /** A single metadata element */ typedef struct grpc_metadata { diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index b2b4fea83cd..2c8113c1dbc 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -110,10 +110,10 @@ static void set_channel_connectivity_state_locked(grpc_exec_ctx *exec_ctx, if ((state == GRPC_CHANNEL_TRANSIENT_FAILURE || state == GRPC_CHANNEL_SHUTDOWN) && chand->lb_policy != NULL) { - /* cancel fail-fast picks */ + /* cancel picks with wait_for_ready=false */ grpc_lb_policy_cancel_picks( exec_ctx, chand->lb_policy, - /* mask= */ GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY, + /* mask= */ GRPC_INITIAL_METADATA_WAIT_FOR_READY, /* check= */ 0); } grpc_connectivity_state_set(exec_ctx, &chand->state_tracker, state, error, diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc index fb9a7c0459e..b6008f47b13 100644 --- a/src/cpp/client/client_context.cc +++ b/src/cpp/client/client_context.cc @@ -60,6 +60,7 @@ static ClientContext::GlobalCallbacks* g_client_callbacks = ClientContext::ClientContext() : initial_metadata_received_(false), wait_for_ready_(false), + wait_for_ready_explicitly_set_(false), idempotent_(false), cacheable_(false), call_(nullptr), From 62cfbea9083b153753dabb90093101b2ca69f321 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 28 Sep 2016 13:35:20 -0700 Subject: [PATCH 035/123] Update pending API cleanups doc. --- doc/core/pending_api_cleanups.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/core/pending_api_cleanups.md b/doc/core/pending_api_cleanups.md index a12e8a9dfbd..a0a960e5e24 100644 --- a/doc/core/pending_api_cleanups.md +++ b/doc/core/pending_api_cleanups.md @@ -15,3 +15,5 @@ number: `include/grpc/impl/codegen/grpc_types.h` (commit `af00d8b`) - remove `ServerBuilder::SetMaxMessageSize()` method from `include/grpc++/server_builder.h` (commit `6980362`) +- remove `GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY` macro from + `include/grpc/impl/codegen/grpc_types.h` (commit `59c9f90`) From 9deb09fa36c80e3b3235365aa707e6d8575296b0 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Wed, 28 Sep 2016 16:03:04 -0700 Subject: [PATCH 036/123] Use NS_OPTIONS flags for ObjC API --- src/objective-c/GRPCClient/GRPCCall.h | 15 ++++++++++++++- src/objective-c/GRPCClient/GRPCCall.m | 4 ++-- src/objective-c/ProtoRPC/ProtoRPC.h | 2 +- src/objective-c/ProtoRPC/ProtoRPC.m | 4 ++-- src/objective-c/ProtoRPC/ProtoService.h | 3 ++- src/objective-c/ProtoRPC/ProtoService.m | 2 +- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 9a58311fe16..1bf25e290d9 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -154,6 +154,19 @@ typedef NS_ENUM(NSUInteger, GRPCErrorCode) { GRPCErrorCodeDataLoss = 15, }; +/** + * Flags for options of a gRPC call + * + */ +typedef NS_OPTIONS(NSUInteger, GRPCCallFlags) { + /** Signal that the call is idempotent */ + GRPCFlagIdempotentRequest = 0x00000010, + /** Signal that the call should not return UNAVAILABLE before it has started */ + GRPCFlagIgnoreConnectivity = 0x00000020, + /** Signal that the call is cacheable. GRPC is free to use GET verb */ + GRPCFlagCacheableRequest = 0x00000040, +}; + /** * Keys used in |NSError|'s |userInfo| dictionary to store the response headers and trailers sent by * the server. @@ -230,7 +243,7 @@ extern id const kGRPCTrailersKey; - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestsWriter - flags:(uint32_t)flags NS_DESIGNATED_INITIALIZER; + flags:(GRPCCallFlags)flags NS_DESIGNATED_INITIALIZER; /** * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 8a58db70514..eb7998ed975 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -75,7 +75,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; NSString *_host; NSString *_path; - uint32_t _flags; + GRPCCallFlags _flags; GRPCWrappedCall *_wrappedCall; GRPCConnectivityMonitor *_connectivityMonitor; @@ -123,7 +123,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestWriter - flags:(uint32_t)flags { + flags:(GRPCCallFlags)flags { if (!host || !path) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; } diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index 75c9b9bb3bc..b2c3e8def32 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -48,7 +48,7 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - flags:(uint32_t)flags NS_DESIGNATED_INITIALIZER; + flags:(GRPCCallFlags)flags NS_DESIGNATED_INITIALIZER; - (void)start; @end diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 2514d616f16..16cb04a83bf 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -66,7 +66,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing - (instancetype)initWithHost:(NSString *)host path:(NSString *)path requestsWriter:(GRXWriter *)requestsWriter - flags:(uint32_t)flags { + flags:(GRPCCallFlags)flags { [NSException raise:NSInvalidArgumentException format:@"Please use ProtoRPC's designated initializer instead."]; return nil; @@ -79,7 +79,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - flags:(uint32_t)flags { + flags:(GRPCCallFlags)flags { // Because we can't tell the type system to constrain the class, we need to check at runtime: if (![responseClass respondsToSelector:@selector(parseFromData:error:)]) { [NSException raise:NSInvalidArgumentException diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 9a49ebd257b..0fd5764dbc0 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -32,6 +32,7 @@ */ #import +#import "ProtoRPC.h" @class GRPCProtoCall; @protocol GRXWriteable; @@ -48,7 +49,7 @@ __attribute__((deprecated("Please use GRPCProtoService."))) requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - flags:(uint32_t)flags; + flags:(GRPCCallFlags)flags; @end diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index b237164a006..53337cd983e 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -69,7 +69,7 @@ requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable - flags:(uint32_t)flags { + flags:(GRPCCallFlags)flags { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; From befac97048f42f55409bb38a34a75c38cbf34241 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 22 Sep 2016 17:15:15 -0700 Subject: [PATCH 037/123] fixed local cloning of grpc/grpc submodules on docker --- test/distrib/cpp/run_distrib_test.sh | 6 +++++- .../grpc_check_generated_pb_files/check_pb_files.sh | 6 +++++- .../interoptest/grpc_interop_csharp/build_interop.sh | 6 +++++- .../grpc_interop_csharpcoreclr/build_interop.sh | 6 +++++- .../interoptest/grpc_interop_cxx/build_interop.sh | 6 +++++- .../interoptest/grpc_interop_http2/build_interop.sh | 6 +++++- .../interoptest/grpc_interop_node/build_interop.sh | 6 +++++- .../interoptest/grpc_interop_php/build_interop.sh | 7 ++++++- .../interoptest/grpc_interop_php7/build_interop.sh | 7 ++++++- .../interoptest/grpc_interop_python/build_interop.sh | 6 +++++- .../interoptest/grpc_interop_ruby/build_interop.sh | 7 ++++++- .../grpc_interop_stress_csharp/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_cxx/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_go/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_java/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_node/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_php/build_interop_stress.sh | 7 ++++++- .../grpc_interop_stress_python/build_interop_stress.sh | 6 +++++- .../grpc_interop_stress_ruby/build_interop_stress.sh | 7 ++++++- tools/run_tests/dockerize/docker_run.sh | 6 +++++- tools/run_tests/dockerize/docker_run_tests.sh | 6 +++++- 21 files changed, 110 insertions(+), 21 deletions(-) diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh index bc84b84b8f3..cd4158eb5d9 100755 --- a/test/distrib/cpp/run_distrib_test.sh +++ b/test/distrib/cpp/run_distrib_test.sh @@ -30,9 +30,13 @@ set -ex -git clone --recursive $EXTERNAL_GIT_ROOT +git clone $EXTERNAL_GIT_ROOT cd grpc +# clone submodules +git submodule | awk -v EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT '{ system("git \ +submodule update --init --reference " EXTERNAL_GIT_ROOT$2 " " $2) }' + cd third_party/protobuf && ./autogen.sh && \ ./configure && make -j4 && make check && make install && ldconfig diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh index 62e41755ec1..fa9fd8fc72e 100755 --- a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -31,10 +31,14 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # build grpc cpp plugin for generating grpc pb files make grpc_cpp_plugin diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh index fd5436c44ff..4ec41b9c30a 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh @@ -32,12 +32,16 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh index 77cd65cce37..073c4625bc3 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh @@ -32,12 +32,16 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --compiler coreclr --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh index 1c0828d23a6..5de62a41c0b 100755 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + make install-certs # build C++ interop client & server diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh index 46ddaf929a8..64418bc63de 100755 --- a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh @@ -32,7 +32,11 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc + +# clone gRPC submodules +(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ +update --init --reference ./../../jenkins/grpc" $2 " " $2) }') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index 976f55d9ab5..85750ed91c2 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # build Node interop client & server npm install -g node-gyp npm install --unsafe-perm --build-from-source diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index a84a450221e..ea149049338 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -32,12 +32,17 @@ set -ex mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc + +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index 261dded2821..0e045631c2f 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -32,12 +32,17 @@ set -ex mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc + +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh index f29c59da8e8..55d1b6f915a 100755 --- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh @@ -32,11 +32,15 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + tools/run_tests/run_tests.py -l python -c opt --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh index 97b3860f981..0290de92099 100755 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh @@ -32,12 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc + +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + rvm --default use ruby-2.1 # build Ruby interop client and server diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh index 1f4bf893cce..a4d7feef95f 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # Build C++ metrics client (to query the metrics from csharp stress client) make metrics_client -j diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh index b67b1a1664a..d704f86496b 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + make install-certs BUILD_TYPE=${BUILD_TYPE:=opt} diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh index 919d885c178..2b3b69be6ee 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh @@ -38,7 +38,11 @@ git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc # Clone the 'grpc' repo. We just need this for the wrapper scripts under # grpc/tools/gcp/stress_tests -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc + +# clone gRPC submodules +(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ +update --init --reference ./../../jenkins/grpc" $2 " " $2) }') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh index d4fdfbbac96..99d287b21bf 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh @@ -36,7 +36,11 @@ mkdir -p /var/local/git git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc-java # grpc repo (for metrics client and for the stress test wrapper scripts) -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc + +# clone gRPC submodules +(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ +update --init --reference ./../../jenkins/grpc" $2 " " $2) }') # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh index 976f55d9ab5..85750ed91c2 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + # build Node interop client & server npm install -g node-gyp npm install --unsafe-perm --build-from-source diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index 87262f1d629..997cda6a35a 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -32,12 +32,17 @@ set -ex mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc + +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + rvm --default use ruby-2.1 make install-certs diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh index e65332f2f30..e3ccd8e00d3 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh @@ -32,13 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + tools/run_tests/run_tests.py -l python -c opt --build_only # Build c++ interop client diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh index 1b7567d87a6..be39fb484b2 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh @@ -32,12 +32,17 @@ set -e mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc + +# clone gRPC submodules +git submodule | awk '{ system("git submodule update --init --reference \ +./../../jenkins/grpc" $2 " " $2) }' + rvm --default use ruby-2.1 # Build Ruby interop client and server diff --git a/tools/run_tests/dockerize/docker_run.sh b/tools/run_tests/dockerize/docker_run.sh index f04b1cfb55b..bb875e275e7 100755 --- a/tools/run_tests/dockerize/docker_run.sh +++ b/tools/run_tests/dockerize/docker_run.sh @@ -36,7 +36,11 @@ set -ex if [ "$RELATIVE_COPY_PATH" == "" ] then mkdir -p /var/local/git - git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc + git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc + # clone gRPC submodules + (cd var/local/git/grpc && exec git submodule | awk -v \ + EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT '{ system("git submodule update --init \ + --reference " EXTERNAL_GIT_ROOT$2 " " $2) }') else mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH" diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 8c6143d24f9..55371589605 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -42,7 +42,11 @@ export PATH=$PATH:/usr/bin/llvm-symbolizer chown $(whoami) $XDG_CACHE_HOME mkdir -p /var/local/git -git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc +git clone /var/local/jenkins/grpc /var/local/git/grpc + +# clone gRPC submodules +(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ +update --init --reference ./../../jenkins/grpc" $2 " " $2) }') mkdir -p reports From ce9471c962d95099e417ee7088376ecf8e017a78 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 22 Sep 2016 18:15:34 -0700 Subject: [PATCH 038/123] fixed wrong directory in git clone commands --- .../dockerfile/interoptest/grpc_interop_csharp/build_interop.sh | 2 +- .../interoptest/grpc_interop_csharpcoreclr/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh | 2 +- .../dockerfile/interoptest/grpc_interop_http2/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh | 2 +- .../dockerfile/interoptest/grpc_interop_python/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh | 2 +- .../grpc_interop_stress_csharp/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_cxx/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_go/build_interop_stress.sh | 2 +- .../grpc_interop_stress_java/build_interop_stress.sh | 2 +- .../grpc_interop_stress_node/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_php/build_interop_stress.sh | 2 +- .../grpc_interop_stress_python/build_interop_stress.sh | 2 +- .../grpc_interop_stress_ruby/build_interop_stress.sh | 2 +- tools/run_tests/dockerize/docker_run_tests.sh | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh index 4ec41b9c30a..50378032dba 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh index 073c4625bc3..c4092743034 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --compiler coreclr --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh index 5de62a41c0b..6f8b41241f9 100755 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' make install-certs diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh index 64418bc63de..9c99bf56f54 100755 --- a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh @@ -36,7 +36,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc" $2 " " $2) }') +update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index 85750ed91c2..c82972d34e8 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # build Node interop client & server npm install -g node-gyp diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index ea149049338..fcdb28dcdf3 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' rvm --default use ruby-2.1 diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index 0e045631c2f..865802e30b6 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' rvm --default use ruby-2.1 diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh index 55d1b6f915a..917477c8471 100755 --- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh @@ -41,6 +41,6 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' tools/run_tests/run_tests.py -l python -c opt --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh index 0290de92099..449a21ff650 100755 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' rvm --default use ruby-2.1 diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh index a4d7feef95f..e25783a0b3b 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # Build C++ metrics client (to query the metrics from csharp stress client) make metrics_client -j diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh index d704f86496b..d223653f92f 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' make install-certs diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh index 2b3b69be6ee..a1d243d411d 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh @@ -42,7 +42,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc" $2 " " $2) }') +update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh index 99d287b21bf..4400e74be54 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh @@ -40,7 +40,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc" $2 " " $2) }') +update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh index 85750ed91c2..c82972d34e8 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # build Node interop client & server npm install -g node-gyp diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index 997cda6a35a..d1ac59fd917 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' rvm --default use ruby-2.1 diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh index e3ccd8e00d3..ee70c1f3a9a 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' tools/run_tests/run_tests.py -l python -c opt --build_only diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh index be39fb484b2..5e47bafe859 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh @@ -41,7 +41,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' rvm --default use ruby-2.1 diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 55371589605..ee4c1a5f05d 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -46,7 +46,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc" $2 " " $2) }') +update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') mkdir -p reports From 41a56ac8acec1576dbdbfdbcbbd0b8c4cea4f58e Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 22 Sep 2016 18:27:01 -0700 Subject: [PATCH 039/123] fixed one more incorrect directory for git clone --- .../dockerfile/grpc_check_generated_pb_files/check_pb_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh index fa9fd8fc72e..b112fb11bb6 100755 --- a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -37,7 +37,7 @@ cd /var/local/git/grpc # clone gRPC submodules git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc" $2 " " $2) }' +./../../jenkins/grpc/" $2 " " $2) }' # build grpc cpp plugin for generating grpc pb files make grpc_cpp_plugin From a436bab47f394c339b6e8978da3317ff94abfdf8 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 22 Sep 2016 18:49:24 -0700 Subject: [PATCH 040/123] fixed incorrect directory when using EXTERNAL_GIT_ROOT in Docker cloning var --- test/distrib/cpp/run_distrib_test.sh | 2 +- tools/run_tests/dockerize/docker_run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh index cd4158eb5d9..9c8da508334 100755 --- a/test/distrib/cpp/run_distrib_test.sh +++ b/test/distrib/cpp/run_distrib_test.sh @@ -34,7 +34,7 @@ git clone $EXTERNAL_GIT_ROOT cd grpc # clone submodules -git submodule | awk -v EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT '{ system("git \ +git submodule | awk -v EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git \ submodule update --init --reference " EXTERNAL_GIT_ROOT$2 " " $2) }' cd third_party/protobuf && ./autogen.sh && \ diff --git a/tools/run_tests/dockerize/docker_run.sh b/tools/run_tests/dockerize/docker_run.sh index bb875e275e7..791ed6d7b00 100755 --- a/tools/run_tests/dockerize/docker_run.sh +++ b/tools/run_tests/dockerize/docker_run.sh @@ -39,7 +39,7 @@ then git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc # clone gRPC submodules (cd var/local/git/grpc && exec git submodule | awk -v \ - EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT '{ system("git submodule update --init \ + EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git submodule update --init \ --reference " EXTERNAL_GIT_ROOT$2 " " $2) }') else mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" From 46c7f574bd4a5298f09fd5d72924b93c355e357e Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Fri, 23 Sep 2016 14:36:23 -0700 Subject: [PATCH 041/123] submodule clone comments changed to be more descriptive --- test/distrib/cpp/run_distrib_test.sh | 2 +- .../dockerfile/grpc_check_generated_pb_files/check_pb_files.sh | 2 +- .../dockerfile/interoptest/grpc_interop_csharp/build_interop.sh | 2 +- .../interoptest/grpc_interop_csharpcoreclr/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh | 2 +- .../dockerfile/interoptest/grpc_interop_http2/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh | 2 +- .../dockerfile/interoptest/grpc_interop_python/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh | 2 +- .../grpc_interop_stress_csharp/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_cxx/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_go/build_interop_stress.sh | 2 +- .../grpc_interop_stress_java/build_interop_stress.sh | 2 +- .../grpc_interop_stress_node/build_interop_stress.sh | 2 +- .../stress_test/grpc_interop_stress_php/build_interop_stress.sh | 2 +- .../grpc_interop_stress_python/build_interop_stress.sh | 2 +- .../grpc_interop_stress_ruby/build_interop_stress.sh | 2 +- tools/run_tests/dockerize/docker_run.sh | 2 +- tools/run_tests/dockerize/docker_run_tests.sh | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh index 9c8da508334..6b2e043491f 100755 --- a/test/distrib/cpp/run_distrib_test.sh +++ b/test/distrib/cpp/run_distrib_test.sh @@ -33,7 +33,7 @@ set -ex git clone $EXTERNAL_GIT_ROOT cd grpc -# clone submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk -v EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git \ submodule update --init --reference " EXTERNAL_GIT_ROOT$2 " " $2) }' diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh index b112fb11bb6..4773a602a4c 100755 --- a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -35,7 +35,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh index 50378032dba..6a0b2ef0605 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh index c4092743034..c2bb64e84b5 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh index 6f8b41241f9..47380c8a125 100755 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh index 9c99bf56f54..3adc8394902 100755 --- a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index c82972d34e8..4b73bb56f80 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index fcdb28dcdf3..48a6444821a 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index 865802e30b6..c2348f4f666 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh index 917477c8471..e85153f51a0 100755 --- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh index 449a21ff650..e5edb5335cb 100755 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh index e25783a0b3b..84920860803 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh index d223653f92f..9ab7aa07274 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh index a1d243d411d..de8430d6778 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh @@ -40,7 +40,7 @@ git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc # grpc/tools/gcp/stress_tests git clone /var/local/jenkins/grpc /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh index 4400e74be54..ffffea18d21 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh @@ -38,7 +38,7 @@ git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc # grpc repo (for metrics client and for the stress test wrapper scripts) git clone /var/local/jenkins/grpc /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh index c82972d34e8..4b73bb56f80 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index d1ac59fd917..78bf32ce519 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh index ee70c1f3a9a..3f85a868032 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh index 5e47bafe859..09b6fb1e117 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh @@ -39,7 +39,7 @@ cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible git submodule | awk '{ system("git submodule update --init --reference \ ./../../jenkins/grpc/" $2 " " $2) }' diff --git a/tools/run_tests/dockerize/docker_run.sh b/tools/run_tests/dockerize/docker_run.sh index 791ed6d7b00..e57ceaf0ac8 100755 --- a/tools/run_tests/dockerize/docker_run.sh +++ b/tools/run_tests/dockerize/docker_run.sh @@ -37,7 +37,7 @@ if [ "$RELATIVE_COPY_PATH" == "" ] then mkdir -p /var/local/git git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc - # clone gRPC submodules + # clone gRPC submodules, use data from locally cloned submodules where possible (cd var/local/git/grpc && exec git submodule | awk -v \ EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git submodule update --init \ --reference " EXTERNAL_GIT_ROOT$2 " " $2) }') diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index ee4c1a5f05d..a1e94b29527 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -44,7 +44,7 @@ chown $(whoami) $XDG_CACHE_HOME mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc -# clone gRPC submodules +# clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') From 5d0f24600ef9b985bef3aada69e2f5847467c53c Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Mon, 26 Sep 2016 12:05:05 -0700 Subject: [PATCH 042/123] changed method to local clone submodules to using git submodule foreach from the local copy --- test/distrib/cpp/run_distrib_test.sh | 10 ++++++---- .../grpc_check_generated_pb_files/check_pb_files.sh | 8 ++++---- .../interoptest/grpc_interop_csharp/build_interop.sh | 8 ++++---- .../grpc_interop_csharpcoreclr/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_cxx/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_http2/build_interop.sh | 6 +++--- .../interoptest/grpc_interop_node/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_php/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_php7/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_python/build_interop.sh | 8 ++++---- .../interoptest/grpc_interop_ruby/build_interop.sh | 8 ++++---- .../grpc_interop_stress_csharp/build_interop_stress.sh | 8 ++++---- .../grpc_interop_stress_cxx/build_interop_stress.sh | 8 ++++---- .../grpc_interop_stress_go/build_interop_stress.sh | 6 +++--- .../grpc_interop_stress_java/build_interop_stress.sh | 6 +++--- .../grpc_interop_stress_node/build_interop_stress.sh | 8 ++++---- .../grpc_interop_stress_php/build_interop_stress.sh | 8 ++++---- .../grpc_interop_stress_python/build_interop_stress.sh | 8 ++++---- .../grpc_interop_stress_ruby/build_interop_stress.sh | 8 ++++---- tools/run_tests/dockerize/docker_run.sh | 6 +++--- tools/run_tests/dockerize/docker_run_tests.sh | 6 +++--- 21 files changed, 81 insertions(+), 79 deletions(-) diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh index 6b2e043491f..4c5deeaaae9 100755 --- a/test/distrib/cpp/run_distrib_test.sh +++ b/test/distrib/cpp/run_distrib_test.sh @@ -31,11 +31,13 @@ set -ex git clone $EXTERNAL_GIT_ROOT -cd grpc - # clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk -v EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git \ -submodule update --init --reference " EXTERNAL_GIT_ROOT$2 " " $2) }' +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') + + +cd grpc cd third_party/protobuf && ./autogen.sh && \ ./configure && make -j4 && make check && make install && ldconfig diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh index 4773a602a4c..71306bfb676 100755 --- a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -32,13 +32,13 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # build grpc cpp plugin for generating grpc pb files make grpc_cpp_plugin diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh index 6a0b2ef0605..8f7be9ba134 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh @@ -33,15 +33,15 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh index c2bb64e84b5..476b69b09ae 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh @@ -33,15 +33,15 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # build C# interop client & server tools/run_tests/run_tests.py -l csharp -c dbg --compiler coreclr --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh index 47380c8a125..0822ed31052 100755 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - make install-certs # build C++ interop client & server diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh index 3adc8394902..907ee6b3642 100755 --- a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh @@ -33,10 +33,10 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc - # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index 4b73bb56f80..30dc8a67046 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # build Node interop client & server npm install -g node-gyp npm install --unsafe-perm --build-from-source diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index 48a6444821a..0fef66e512b 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -33,16 +33,16 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index c2348f4f666..5d891c6c0b3 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -33,16 +33,16 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh index e85153f51a0..4ffd2a63c39 100755 --- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh @@ -33,14 +33,14 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - tools/run_tests/run_tests.py -l python -c opt --build_only diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh index e5edb5335cb..68aa7a1643a 100755 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - rvm --default use ruby-2.1 # build Ruby interop client and server diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh index 84920860803..7f2d587e59a 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # Build C++ metrics client (to query the metrics from csharp stress client) make metrics_client -j diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh index 9ab7aa07274..7332a8c1bbe 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - make install-certs BUILD_TYPE=${BUILD_TYPE:=opt} diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh index de8430d6778..f0a54a43626 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh @@ -39,10 +39,10 @@ git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc # Clone the 'grpc' repo. We just need this for the wrapper scripts under # grpc/tools/gcp/stress_tests git clone /var/local/jenkins/grpc /var/local/git/grpc - # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh index ffffea18d21..dcd3a0644a2 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh @@ -37,10 +37,10 @@ git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc # grpc repo (for metrics client and for the stress test wrapper scripts) git clone /var/local/jenkins/grpc /var/local/git/grpc - # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh index 4b73bb56f80..30dc8a67046 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - # build Node interop client & server npm install -g node-gyp npm install --unsafe-perm --build-from-source diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index 78bf32ce519..0f624bf3217 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -33,16 +33,16 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - rvm --default use ruby-2.1 make install-certs diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh index 3f85a868032..57b916ca4dd 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - tools/run_tests/run_tests.py -l python -c opt --build_only # Build c++ interop client diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh index 09b6fb1e117..bb4d2fcd224 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh @@ -33,16 +33,16 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') # Copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -git submodule | awk '{ system("git submodule update --init --reference \ -./../../jenkins/grpc/" $2 " " $2) }' - rvm --default use ruby-2.1 # Build Ruby interop client and server diff --git a/tools/run_tests/dockerize/docker_run.sh b/tools/run_tests/dockerize/docker_run.sh index e57ceaf0ac8..d50ea81750b 100755 --- a/tools/run_tests/dockerize/docker_run.sh +++ b/tools/run_tests/dockerize/docker_run.sh @@ -38,9 +38,9 @@ then mkdir -p /var/local/git git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible - (cd var/local/git/grpc && exec git submodule | awk -v \ - EXTERNAL_GIT_ROOT=$EXTERNAL_GIT_ROOT/ '{ system("git submodule update --init \ - --reference " EXTERNAL_GIT_ROOT$2 " " $2) }') + (cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ + && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ + ${name}') else mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH" diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index a1e94b29527..41d93e444d4 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -43,10 +43,10 @@ chown $(whoami) $XDG_CACHE_HOME mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc - # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/git/grpc/ && exec git submodule | awk '{ system("git submodule \ -update --init --reference ./../../jenkins/grpc/" $2 " " $2) }') +(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') mkdir -p reports From 10dcccadfb1400bdc016ad2861b601a9d2574d04 Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Wed, 28 Sep 2016 16:52:34 -0700 Subject: [PATCH 043/123] fixed whitespacing and docker_run_tests.sh now clones submodule via network --- test/distrib/cpp/run_distrib_test.sh | 5 ++--- .../check_pb_files.sh | 2 +- .../grpc_interop_csharp/build_interop.sh | 2 +- .../build_interop.sh | 2 +- .../grpc_interop_cxx/build_interop.sh | 2 +- .../grpc_interop_http2/build_interop.sh | 2 +- .../grpc_interop_node/build_interop.sh | 2 +- .../grpc_interop_php/build_interop.sh | 3 +-- .../grpc_interop_php7/build_interop.sh | 3 +-- .../grpc_interop_python/build_interop.sh | 2 +- .../grpc_interop_ruby/build_interop.sh | 3 +-- .../build_interop_stress.sh | 2 +- .../build_interop_stress.sh | 2 +- .../build_interop_stress.sh | 2 +- .../build_interop_stress.sh | 2 +- .../build_interop_stress.sh | 2 +- .../build_interop_stress.sh | 3 +-- .../build_interop_stress.sh | 3 +-- .../build_interop_stress.sh | 3 +-- tools/run_tests/dockerize/docker_run.sh | 6 +++--- tools/run_tests/dockerize/docker_run_tests.sh | 18 ++++++++++++++---- 21 files changed, 37 insertions(+), 34 deletions(-) diff --git a/test/distrib/cpp/run_distrib_test.sh b/test/distrib/cpp/run_distrib_test.sh index 4c5deeaaae9..15fbf281074 100755 --- a/test/distrib/cpp/run_distrib_test.sh +++ b/test/distrib/cpp/run_distrib_test.sh @@ -32,10 +32,9 @@ set -ex git clone $EXTERNAL_GIT_ROOT # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ -&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +(cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \ ${name}') - cd grpc diff --git a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh index 71306bfb676..9db7aae9eba 100755 --- a/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh +++ b/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh @@ -33,7 +33,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh index 8f7be9ba134..e37070904d3 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh index 476b69b09ae..d90c899569f 100755 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh index 0822ed31052..7a7ca0d3d1c 100755 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh index 907ee6b3642..a1d668d69fc 100755 --- a/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_http2/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index 30dc8a67046..4116f842ff1 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index 0fef66e512b..ea2f88f2d2d 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -34,7 +34,7 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index 5d891c6c0b3..259b7e09750 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -34,7 +34,7 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - rvm --default use ruby-2.1 # gRPC core and protobuf need to be installed diff --git a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh index 4ffd2a63c39..a6f8c7bfe6b 100755 --- a/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_python/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh index 68aa7a1643a..6cd2fa2b147 100755 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/build_interop.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - rvm --default use ruby-2.1 # build Ruby interop client and server diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh index 7f2d587e59a..345196894ef 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_csharp/build_interop_stress.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh index 7332a8c1bbe..92d1f80fe60 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_cxx/build_interop_stress.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh index f0a54a43626..9e4769cf334 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_go/build_interop_stress.sh @@ -40,7 +40,7 @@ git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc # grpc/tools/gcp/stress_tests git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh index dcd3a0644a2..0194860d101 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_java/build_interop_stress.sh @@ -38,7 +38,7 @@ git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc # grpc repo (for metrics client and for the stress test wrapper scripts) git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh index 30dc8a67046..4116f842ff1 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_node/build_interop_stress.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index 0f624bf3217..c6d03ea28e0 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -34,7 +34,7 @@ set -ex mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - rvm --default use ruby-2.1 make install-certs diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh index 57b916ca4dd..1c7dc2bd577 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_python/build_interop_stress.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - tools/run_tests/run_tests.py -l python -c opt --build_only # Build c++ interop client diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh index bb4d2fcd224..019f0a44e4c 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_ruby/build_interop_stress.sh @@ -34,7 +34,7 @@ set -e mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ ${name}') @@ -42,7 +42,6 @@ ${name}') cp -r /var/local/jenkins/service_account $HOME || true cd /var/local/git/grpc - rvm --default use ruby-2.1 # Build Ruby interop client and server diff --git a/tools/run_tests/dockerize/docker_run.sh b/tools/run_tests/dockerize/docker_run.sh index d50ea81750b..ee8d288fb2a 100755 --- a/tools/run_tests/dockerize/docker_run.sh +++ b/tools/run_tests/dockerize/docker_run.sh @@ -36,10 +36,10 @@ set -ex if [ "$RELATIVE_COPY_PATH" == "" ] then mkdir -p /var/local/git - git clone "$EXTERNAL_GIT_ROOT" /var/local/git/grpc + git clone $EXTERNAL_GIT_ROOT /var/local/git/grpc # clone gRPC submodules, use data from locally cloned submodules where possible - (cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ - && git submodule update --init --reference /var/local/jenkins/grpc/${name} \ + (cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \ + && git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \ ${name}') else mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 41d93e444d4..3bab7ffd903 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -43,10 +43,20 @@ chown $(whoami) $XDG_CACHE_HOME mkdir -p /var/local/git git clone /var/local/jenkins/grpc /var/local/git/grpc -# clone gRPC submodules, use data from locally cloned submodules where possible -(cd /var/local/jenkins/grpc / && git submodule foreach 'cd /var/local/git/grpc \ -&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ -${name}') + +# (todo (mattkwong): the /var/local/jenkins/grpc has no submodules and boringssl +# has non-submodule files in it. Figure out how to fix this for local cloning +## this prints to console "reports reports.zip" +# ls /var/local/jenkins/grpc/third_party/boringssl +## none of these print anything (empty directory) +# ls /var/local/jenkins/grpc/third_party/gflags +# ls /var/local/jenkins/grpc/third_party/googletest +# ls /var/local/jenkins/grpc/third_party/nanopb +# ls /var/local/jenkins/grpc/third_party/protobuf +# ls /var/local/jenkins/grpc/third_party/thrift +# ls /var/local/jenkins/grpc/third_party/zlib + +(cd /var/local/git/grpc && git submodule update --init --recursive ) mkdir -p reports From a40d4711104708152c56c1246a41eb9160e18df2 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 29 Sep 2016 10:05:50 -0700 Subject: [PATCH 044/123] Plumb through GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET. --- include/grpc++/impl/codegen/client_context.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/grpc++/impl/codegen/client_context.h b/include/grpc++/impl/codegen/client_context.h index dd37e6a8503..a330ed06bbe 100644 --- a/include/grpc++/impl/codegen/client_context.h +++ b/include/grpc++/impl/codegen/client_context.h @@ -354,7 +354,10 @@ class ClientContext { uint32_t initial_metadata_flags() const { return (idempotent_ ? GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST : 0) | (wait_for_ready_ ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0) | - (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0); + (cacheable_ ? GRPC_INITIAL_METADATA_CACHEABLE_REQUEST : 0) | + (wait_for_ready_explicitly_set_ + ? GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET + : 0); } grpc::string authority() { return authority_; } From 66a1eea681b1337340e33abd211a8fb1233e8eab Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Thu, 29 Sep 2016 18:30:19 -0700 Subject: [PATCH 045/123] changed wheezy dockerfile to install git version > 1.7 to support local submodule cloning --- .../dockerfile/test/cxx_wheezy_x64/Dockerfile | 7 +++++++ tools/run_tests/dockerize/docker_run_tests.sh | 20 +++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile index c25033387f9..503a4357070 100644 --- a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile @@ -63,6 +63,13 @@ RUN apt-get update && apt-get install -y \ # Build profiling RUN apt-get update && apt-get install -y time && apt-get clean +#================ +# Add backport to Debian sources.list and update git to version > 1.7 +RUN echo "deb http://http.debian.net/debian wheezy-backports main" \ + >/etc/apt/sources.list.d/wheezy-backports.list +RUN apt-get update -qq +RUN apt-get -t wheezy-backports install -y -qq git mercurial + #==================== # Python dependencies diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 3bab7ffd903..7108964a9bc 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -42,21 +42,11 @@ export PATH=$PATH:/usr/bin/llvm-symbolizer chown $(whoami) $XDG_CACHE_HOME mkdir -p /var/local/git -git clone /var/local/jenkins/grpc /var/local/git/grpc - -# (todo (mattkwong): the /var/local/jenkins/grpc has no submodules and boringssl -# has non-submodule files in it. Figure out how to fix this for local cloning -## this prints to console "reports reports.zip" -# ls /var/local/jenkins/grpc/third_party/boringssl -## none of these print anything (empty directory) -# ls /var/local/jenkins/grpc/third_party/gflags -# ls /var/local/jenkins/grpc/third_party/googletest -# ls /var/local/jenkins/grpc/third_party/nanopb -# ls /var/local/jenkins/grpc/third_party/protobuf -# ls /var/local/jenkins/grpc/third_party/thrift -# ls /var/local/jenkins/grpc/third_party/zlib - -(cd /var/local/git/grpc && git submodule update --init --recursive ) +git clone /var/local/jenkins/grpc /var/local/git/grpc +# clone gRPC submodules, use data from locally cloned submodules where possible +(cd /var/local/jenkins/grpc/ && git submodule foreach 'cd /var/local/git/grpc \ +&& git submodule update --init --reference /var/local/jenkins/grpc/${name} \ +${name}') mkdir -p reports From eb7574b39b2d3c1d3f077bdebe7e548eca283d6e Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 30 Sep 2016 10:48:19 -0700 Subject: [PATCH 046/123] clang-format --- include/grpc/impl/codegen/grpc_types.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/grpc/impl/codegen/grpc_types.h b/include/grpc/impl/codegen/grpc_types.h index 64602ea228c..ebeef038d1b 100644 --- a/include/grpc/impl/codegen/grpc_types.h +++ b/include/grpc/impl/codegen/grpc_types.h @@ -260,7 +260,7 @@ typedef enum grpc_call_error { #define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u) /** DEPRECATED: for backward compatibility */ #define GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY \ - GRPC_INITIAL_METADATA_WAIT_FOR_READY + GRPC_INITIAL_METADATA_WAIT_FOR_READY /** Signal that the call is cacheable. GRPC is free to use GET verb */ #define GRPC_INITIAL_METADATA_CACHEABLE_REQUEST (0x00000040u) /** Signal that GRPC_INITIAL_METADATA_WAIT_FOR_READY was explicitly set @@ -268,10 +268,10 @@ typedef enum grpc_call_error { #define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u) /** Mask of all valid flags */ -#define GRPC_INITIAL_METADATA_USED_MASK \ - (GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \ - GRPC_INITIAL_METADATA_WAIT_FOR_READY | \ - GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \ +#define GRPC_INITIAL_METADATA_USED_MASK \ + (GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST | \ + GRPC_INITIAL_METADATA_WAIT_FOR_READY | \ + GRPC_INITIAL_METADATA_CACHEABLE_REQUEST | \ GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET) /** A single metadata element */ From b6cf4944a5f4fda11f240b3c1b9736c61d299e5b Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 10:49:57 -0700 Subject: [PATCH 047/123] s/flat/flag --- doc/interop-test-descriptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 92824df23d6..97d76191a8f 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -82,7 +82,7 @@ Procedure: request context. Longer term this should be driven by the method option specified in the proto file itself. 2. Client calls CacheableUnaryCall with `SimpleRequest` request again - immediately with the same payload as the previous request. Cacheable flat is + immediately with the same payload as the previous request. Cacheable flag is also set for this request's context. Client asserts: From c9beacadb1f9b0cd8858ce59d6cbed01b7f48cd3 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 11:26:13 -0700 Subject: [PATCH 048/123] fix for gcc 4.4 warning --- test/cpp/interop/interop_server.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index e5e62dfc1ae..b58b744b920 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -157,7 +157,7 @@ class TestServiceImpl : public TestService::Service { Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, SimpleResponse* response) { gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); - std::string timestamp = std::to_string(ts.tv_nsec); + std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); context->AddInitialMetadata("cache-control", "max-age=60, public"); return Status::OK; From 92eb6b92d7ecb554d90d1f1f698ec1476160b6fc Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 30 Sep 2016 14:07:39 -0700 Subject: [PATCH 049/123] Use call's deadline for internal grpclb call --- src/core/ext/client_config/client_channel.c | 6 +-- src/core/ext/client_config/lb_policy.h | 6 ++- src/core/ext/lb_policy/grpclb/grpclb.c | 55 +++++++++------------ 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index feb4cbde7b5..0c1b2445bfb 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -602,9 +602,9 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, int r; GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel"); gpr_mu_unlock(&chand->mu); - const grpc_lb_policy_pick_args inputs = {calld->pollent, initial_metadata, - initial_metadata_flags, - &calld->lb_token_mdelem}; + const grpc_lb_policy_pick_args inputs = { + calld->pollent, initial_metadata, initial_metadata_flags, + &calld->lb_token_mdelem, calld->deadline}; r = grpc_lb_policy_pick(exec_ctx, lb_policy, &inputs, connected_subchannel, NULL, on_ready); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel"); diff --git a/src/core/ext/client_config/lb_policy.h b/src/core/ext/client_config/lb_policy.h index 7fb3e08cb3e..376bb2da631 100644 --- a/src/core/ext/client_config/lb_policy.h +++ b/src/core/ext/client_config/lb_policy.h @@ -59,10 +59,14 @@ typedef struct grpc_lb_policy_pick_args { grpc_polling_entity *pollent; /** Initial metadata associated with the picking call. */ grpc_metadata_batch *initial_metadata; - /** See \a GRPC_INITIAL_METADATA_* in grpc_types.h */ + /** Bitmask used for selective cancelling. See \a + * grpc_lb_policy_cancel_picks() and \a GRPC_INITIAL_METADATA_* in + * grpc_types.h */ uint32_t initial_metadata_flags; /** Storage for LB token in \a initial_metadata, or NULL if not used */ grpc_linked_mdelem *lb_token_mdelem_storage; + /** Deadline associated with the picking call. */ + gpr_timespec deadline; } grpc_lb_policy_pick_args; struct grpc_lb_policy_vtable { diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index bdfe65a62a4..b9307d18662 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -199,18 +199,8 @@ static void wrapped_rr_closure(grpc_exec_ctx *exec_ctx, void *arg, typedef struct pending_pick { struct pending_pick *next; - /* polling entity for the pick()'s async notification */ - grpc_polling_entity *pollent; - - /* the initial metadata for the pick. See grpc_lb_policy_pick() */ - grpc_metadata_batch *initial_metadata; - - /* storage for the lb token initial metadata mdelem */ - grpc_linked_mdelem *lb_token_mdelem_storage; - - /* bitmask passed to pick() and used for selective cancelling. See - * grpc_lb_policy_cancel_picks() */ - uint32_t initial_metadata_flags; + /* original pick()'s arguments */ + grpc_lb_policy_pick_args pick_args; /* output argument where to store the pick()ed connected subchannel, or NULL * upon error. */ @@ -232,11 +222,8 @@ static void add_pending_pick(pending_pick **root, memset(pp, 0, sizeof(pending_pick)); memset(&pp->wrapped_on_complete_arg, 0, sizeof(wrapped_rr_closure_arg)); pp->next = *root; - pp->pollent = pick_args->pollent; + pp->pick_args = *pick_args; pp->target = target; - pp->initial_metadata = pick_args->initial_metadata; - pp->initial_metadata_flags = pick_args->initial_metadata_flags; - pp->lb_token_mdelem_storage = pick_args->lb_token_mdelem_storage; pp->wrapped_on_complete_arg.wrapped_closure = on_complete; pp->wrapped_on_complete_arg.target = target; pp->wrapped_on_complete_arg.initial_metadata = pick_args->initial_metadata; @@ -283,9 +270,13 @@ typedef struct glb_lb_policy { /** mutex protecting remaining members */ gpr_mu mu; + /** who the client is trying to communicate with */ const char *server_name; grpc_client_channel_factory *cc_factory; + /** deadline for the original client's call */ + gpr_timespec deadline; + /** for communicating with the LB server */ grpc_channel *lb_channel; @@ -486,10 +477,8 @@ static void rr_handover(grpc_exec_ctx *exec_ctx, glb_lb_policy *glb_policy, gpr_log(GPR_INFO, "Pending pick about to PICK from 0x%" PRIxPTR "", (intptr_t)glb_policy->rr_policy); } - const grpc_lb_policy_pick_args pick_args = { - pp->pollent, pp->initial_metadata, pp->initial_metadata_flags, - pp->lb_token_mdelem_storage}; - grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, &pick_args, pp->target, + grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, &pp->pick_args, + pp->target, (void **)&pp->wrapped_on_complete_arg.lb_token, &pp->wrapped_on_complete); pp->wrapped_on_complete_arg.owning_pending_node = pp; @@ -698,7 +687,7 @@ static void glb_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, pending_pick *next = pp->next; if (pp->target == target) { grpc_polling_entity_del_from_pollset_set( - exec_ctx, pp->pollent, glb_policy->base.interested_parties); + exec_ctx, pp->pick_args.pollent, glb_policy->base.interested_parties); *target = NULL; grpc_exec_ctx_sched( exec_ctx, &pp->wrapped_on_complete, @@ -729,10 +718,10 @@ static void glb_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, glb_policy->pending_picks = NULL; while (pp != NULL) { pending_pick *next = pp->next; - if ((pp->initial_metadata_flags & initial_metadata_flags_mask) == + if ((pp->pick_args.initial_metadata_flags & initial_metadata_flags_mask) == initial_metadata_flags_eq) { grpc_polling_entity_del_from_pollset_set( - exec_ctx, pp->pollent, glb_policy->base.interested_parties); + exec_ctx, pp->pick_args.pollent, glb_policy->base.interested_parties); grpc_exec_ctx_sched( exec_ctx, &pp->wrapped_on_complete, GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL); @@ -767,8 +756,6 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, const grpc_lb_policy_pick_args *pick_args, grpc_connected_subchannel **target, void **user_data, grpc_closure *on_complete) { - glb_lb_policy *glb_policy = (glb_lb_policy *)pol; - if (pick_args->lb_token_mdelem_storage == NULL) { *target = NULL; grpc_exec_ctx_sched( @@ -779,8 +766,10 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, return 1; } + glb_lb_policy *glb_policy = (glb_lb_policy *)pol; gpr_mu_lock(&glb_policy->mu); - int r; + glb_policy->deadline = pick_args->deadline; + bool pick_done; if (glb_policy->rr_policy != NULL) { if (grpc_lb_glb_trace) { @@ -799,10 +788,11 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_closure_init(&glb_policy->wrapped_on_complete, wrapped_rr_closure, &glb_policy->wc_arg); - r = grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, pick_args, target, + pick_done = + grpc_lb_policy_pick(exec_ctx, glb_policy->rr_policy, pick_args, target, (void **)&glb_policy->wc_arg.lb_token, &glb_policy->wrapped_on_complete); - if (r != 0) { + if (pick_done) { /* synchronous grpc_lb_policy_pick call. Unref the RR policy. */ if (grpc_lb_glb_trace) { gpr_log(GPR_INFO, "Unreffing RR (0x%" PRIxPTR ")", @@ -815,6 +805,8 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, pick_args->initial_metadata, pick_args->lb_token_mdelem_storage, GRPC_MDELEM_REF(glb_policy->wc_arg.lb_token)); } + /* else, the pending pick will be registered and taken care of by the + * pending pick list inside the RR policy (glb_policy->rr_policy) */ } else { grpc_polling_entity_add_to_pollset_set(exec_ctx, pick_args->pollent, glb_policy->base.interested_parties); @@ -824,10 +816,10 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, if (!glb_policy->started_picking) { start_picking(exec_ctx, glb_policy); } - r = 0; + pick_done = false; } gpr_mu_unlock(&glb_policy->mu); - return r; + return pick_done; } static grpc_connectivity_state glb_check_connectivity( @@ -937,8 +929,7 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) { grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client); grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client); - /* TODO(dgq): get the deadline from the parent channel. */ - lb_client->deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC); + lb_client->deadline = glb_policy->deadline; /* Note the following LB call progresses every time there's activity in \a * glb_policy->base.interested_parties, which is comprised of the polling From bd57bba0c22b352478023bc2b43203f808a44399 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 30 Sep 2016 14:44:56 -0700 Subject: [PATCH 050/123] Use a reasonable deadline in grpclb test --- test/cpp/grpclb/grpclb_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index bbb983fc09c..5fc03721afc 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -460,7 +460,7 @@ static void perform_request(client_fixture *cf) { c = grpc_channel_create_call(cf->client, NULL, GRPC_PROPAGATE_DEFAULTS, cf->cq, "/foo", "foo.test.google.fr:1234", - GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1000), NULL); + GRPC_TIMEOUT_SECONDS_TO_DEADLINE(5), NULL); gpr_log(GPR_INFO, "Call 0x%" PRIxPTR " created", (intptr_t)c); GPR_ASSERT(c); char *peer; From 22f7973179b42e36ba46105fc11fa19d25fd9d07 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 30 Sep 2016 14:24:56 -0700 Subject: [PATCH 051/123] ObjC API update --- src/objective-c/GRPCClient/GRPCCall.h | 24 ++++++++------- src/objective-c/GRPCClient/GRPCCall.m | 41 ++++++++++++++++++------- src/objective-c/ProtoRPC/ProtoRPC.h | 3 +- src/objective-c/ProtoRPC/ProtoRPC.m | 9 ++---- src/objective-c/ProtoRPC/ProtoService.h | 3 +- src/objective-c/ProtoRPC/ProtoService.m | 6 ++-- 6 files changed, 50 insertions(+), 36 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 1bf25e290d9..4b28cade42e 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -158,13 +158,12 @@ typedef NS_ENUM(NSUInteger, GRPCErrorCode) { * Flags for options of a gRPC call * */ -typedef NS_OPTIONS(NSUInteger, GRPCCallFlags) { +typedef NS_ENUM(NSUInteger, GRPCCallAttr) { + GRPCCallAttrDefault = 0, /** Signal that the call is idempotent */ - GRPCFlagIdempotentRequest = 0x00000010, - /** Signal that the call should not return UNAVAILABLE before it has started */ - GRPCFlagIgnoreConnectivity = 0x00000020, + GRPCCallAttrIdempotentRequest = 1, /** Signal that the call is cacheable. GRPC is free to use GET verb */ - GRPCFlagCacheableRequest = 0x00000040, + GRPCCallAttrCacheableRequest = 2, }; /** @@ -238,12 +237,7 @@ extern id const kGRPCTrailersKey; */ - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestsWriter; - -- (instancetype)initWithHost:(NSString *)host - path:(NSString *)path - requestsWriter:(GRXWriter *)requestsWriter - flags:(GRPCCallFlags)flags NS_DESIGNATED_INITIALIZER; + requestsWriter:(GRXWriter *)requestsWriter NS_DESIGNATED_INITIALIZER; /** * Finishes the request side of this call, notifies the server that the RPC should be cancelled, and @@ -251,6 +245,14 @@ extern id const kGRPCTrailersKey; */ - (void)cancel; +/** + * Set the call flag for a specific host path. + * + * Host parameter should not contain the scheme (http:// or https://), only the name or IP addr + * and the port number, for example @"localhost:5050". + */ ++ (void)setCallAttribute:(GRPCCallAttr)callAttr host:(NSString *)host path:(NSString *)path; + // TODO(jcanizales): Let specify a deadline. As a category of GRXWriter? @end diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index eb7998ed975..2c0b7799452 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -47,6 +47,7 @@ NSString * const kGRPCHeadersKey = @"io.grpc.HeadersKey"; NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; +static NSMutableDictionary *callFlags; @interface GRPCCall () // Make them read-write. @@ -75,7 +76,6 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; NSString *_host; NSString *_path; - GRPCCallFlags _flags; GRPCWrappedCall *_wrappedCall; GRPCConnectivityMonitor *_connectivityMonitor; @@ -107,23 +107,43 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; // TODO(jcanizales): If grpc_init is idempotent, this should be changed from load to initialize. + (void)load { grpc_init(); + callFlags = [NSMutableDictionary dictionary]; } -- (instancetype)init { - return [self initWithHost:nil path:nil requestsWriter:nil flags:0]; ++ (void)setCallAttribute:(GRPCCallAttr)callAttr host:(NSString *)host path:(NSString *)path { + NSString *hostAndPath = [NSString stringWithFormat:@"%@%@", host, path]; + switch (callAttr) { + case GRPCCallAttrDefault: + callFlags[hostAndPath] = @0; + break; + case GRPCCallAttrIdempotentRequest: + callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST; + break; + case GRPCCallAttrCacheableRequest: + callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_CACHEABLE_REQUEST; + break; + default: + break; + } } -- (instancetype)initWithHost:(NSString *)host - path:(NSString *)path - requestsWriter:(GRXWriter *)requestWriter{ - return [self initWithHost:host path:path requestsWriter:requestWriter flags:0]; ++ (uint32_t)getCallFlag:(NSString *)host path:(NSString *)path { + NSString *hostAndPath = [NSString stringWithFormat:@"%@%@", host, path]; + if (nil != [callFlags objectForKey:hostAndPath]) { + return [callFlags[hostAndPath] intValue]; + } else { + return 0; + } +} + +- (instancetype)init { + return [self initWithHost:nil path:nil requestsWriter:nil]; } // Designated initializer - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestWriter - flags:(GRPCCallFlags)flags { + requestsWriter:(GRXWriter *)requestWriter { if (!host || !path) { [NSException raise:NSInvalidArgumentException format:@"Neither host nor path can be nil."]; } @@ -134,7 +154,6 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; if ((self = [super init])) { _host = [host copy]; _path = [path copy]; - _flags = flags; // Serial queue to invoke the non-reentrant methods of the grpc_call object. _callQueue = dispatch_queue_create("io.grpc.call", NULL); @@ -240,7 +259,7 @@ NSString * const kGRPCTrailersKey = @"io.grpc.TrailersKey"; - (void)sendHeaders:(NSDictionary *)headers { // TODO(jcanizales): Add error handlers for async failures [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendMetadata alloc] initWithMetadata:headers - flags:_flags + flags:(uint32_t)[GRPCCall getCallFlag:_host path:_path] handler:nil]]]; } diff --git a/src/objective-c/ProtoRPC/ProtoRPC.h b/src/objective-c/ProtoRPC/ProtoRPC.h index b2c3e8def32..04fc1e45f16 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.h +++ b/src/objective-c/ProtoRPC/ProtoRPC.h @@ -47,8 +47,7 @@ __attribute__((deprecated("Please use GRPCProtoCall."))) method:(GRPCProtoMethod *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable - flags:(GRPCCallFlags)flags NS_DESIGNATED_INITIALIZER; + responsesWriteable:(id)responsesWriteable NS_DESIGNATED_INITIALIZER; - (void)start; @end diff --git a/src/objective-c/ProtoRPC/ProtoRPC.m b/src/objective-c/ProtoRPC/ProtoRPC.m index 16cb04a83bf..83d1b655e8d 100644 --- a/src/objective-c/ProtoRPC/ProtoRPC.m +++ b/src/objective-c/ProtoRPC/ProtoRPC.m @@ -65,8 +65,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing #pragma clang diagnostic ignored "-Wobjc-designated-initializers" - (instancetype)initWithHost:(NSString *)host path:(NSString *)path - requestsWriter:(GRXWriter *)requestsWriter - flags:(GRPCCallFlags)flags { + requestsWriter:(GRXWriter *)requestsWriter { [NSException raise:NSInvalidArgumentException format:@"Please use ProtoRPC's designated initializer instead."]; return nil; @@ -78,8 +77,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing method:(GRPCProtoMethod *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable - flags:(GRPCCallFlags)flags { + responsesWriteable:(id)responsesWriteable { // Because we can't tell the type system to constrain the class, we need to check at runtime: if (![responseClass respondsToSelector:@selector(parseFromData:error:)]) { [NSException raise:NSInvalidArgumentException @@ -93,8 +91,7 @@ static NSError *ErrorForBadProto(id proto, Class expectedClass, NSError *parsing } return [proto data]; }]; - if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter - flags:flags])) { + if ((self = [super initWithHost:host path:method.HTTPPath requestsWriter:bytesWriter])) { __weak ProtoRPC *weakSelf = self; // A writeable that parses the proto messages received. diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 0fd5764dbc0..5a19fb35db0 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -48,8 +48,7 @@ __attribute__((deprecated("Please use GRPCProtoService."))) - (GRPCProtoCall *)RPCToMethod:(NSString *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable - flags:(GRPCCallFlags)flags; + responsesWriteable:(id)responsesWriteable; @end diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index 53337cd983e..3487fac59d3 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -68,8 +68,7 @@ - (GRPCProtoCall *)RPCToMethod:(NSString *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable - flags:(GRPCCallFlags)flags { + responsesWriteable:(id)responsesWriteable { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; @@ -77,8 +76,7 @@ method:methodName requestsWriter:requestsWriter responseClass:responseClass - responsesWriteable:responsesWriteable - flags:flags]; + responsesWriteable:responsesWriteable]; } @end From 1bd5c77a655ade2bcc39110996dcdec16209e105 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 30 Sep 2016 15:13:58 -0700 Subject: [PATCH 052/123] Add idempotent test --- src/objective-c/tests/GRPCClientTests.m | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index 916a335802a..ce6ceee586a 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -317,4 +317,37 @@ static GRPCProtoMethod *kUnaryCallMethod; } +- (void)testIdempotentProtoRPC { + __weak XCTestExpectation *response = [self expectationWithDescription:@"Expected response."]; + __weak XCTestExpectation *completion = [self expectationWithDescription:@"RPC completed."]; + + RMTSimpleRequest *request = [RMTSimpleRequest message]; + request.responseSize = 100; + request.fillUsername = YES; + request.fillOauthScope = YES; + GRXWriter *requestsWriter = [GRXWriter writerWithValue:[request data]]; + + GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress + path:kUnaryCallMethod.HTTPPath + requestsWriter:requestsWriter]; + [GRPCCall setCallAttribute:GRPCCallAttrIdempotentRequest host:kHostAddress path:kUnaryCallMethod.HTTPPath]; + + id responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { + XCTAssertNotNil(value, @"nil value received as response."); + XCTAssertGreaterThan(value.length, 0, @"Empty response received."); + RMTSimpleResponse *responseProto = [RMTSimpleResponse parseFromData:value error:NULL]; + // We expect empty strings, not nil: + XCTAssertNotNil(responseProto.username, @"Response's username is nil."); + XCTAssertNotNil(responseProto.oauthScope, @"Response's OAuth scope is nil."); + [response fulfill]; + } completionHandler:^(NSError *errorOrNil) { + XCTAssertNil(errorOrNil, @"Finished with unexpected error: %@", errorOrNil); + [completion fulfill]; + }]; + + [call startWithWriteable:responsesWriteable]; + + [self waitForExpectationsWithTimeout:8 handler:nil]; +} + @end From b58c2db6167cee26327e611ffccba499b8bd7015 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Fri, 30 Sep 2016 16:21:11 -0700 Subject: [PATCH 053/123] yet another gcc 4.4 compile fix. --- test/cpp/interop/interop_client.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index f323090ebf0..2fbd6a98cdc 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -850,7 +850,7 @@ bool InteropClient::DoCacheableUnary() { // Create request with current timestamp gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); - std::string timestamp = std::to_string(ts.tv_nsec); + std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); SimpleRequest request; request.mutable_payload()->set_body(timestamp.c_str(), timestamp.size()); From 461fed13cbc581e5593830b228a45e656163b012 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 30 Sep 2016 16:25:35 -0700 Subject: [PATCH 054/123] Resolve memory leak in cronet_transport --- .../cronet/transport/cronet_transport.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 366690acf2b..1a731f5885c 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -341,6 +341,11 @@ static void on_failed(cronet_bidirectional_stream *stream, int net_error) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } + if (s->state.rs.read_buffer && + s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { + gpr_free(s->state.rs.read_buffer); + s->state.rs.read_buffer = NULL; + } gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -363,6 +368,11 @@ static void on_canceled(cronet_bidirectional_stream *stream) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } + if (s->state.rs.read_buffer && + s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { + gpr_free(s->state.rs.read_buffer); + s->state.rs.read_buffer = NULL; + } gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -377,6 +387,11 @@ static void on_succeeded(cronet_bidirectional_stream *stream) { cronet_bidirectional_stream_destroy(s->cbs); s->state.state_callback_received[OP_SUCCEEDED] = true; s->cbs = NULL; + if (s->state.rs.read_buffer && + s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { + gpr_free(s->state.rs.read_buffer); + s->state.rs.read_buffer = NULL; + } gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -901,6 +916,11 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, uint8_t *dst_p = GPR_SLICE_START_PTR(read_data_slice); memcpy(dst_p, stream_state->rs.read_buffer, (size_t)stream_state->rs.length_field); + if (stream_state.rs.read_buffer && + stream_state.rs.read_buffer != stream_state.rs.grpc_header_bytes) { + gpr_free(stream_state.rs.read_buffer); + stream_state.rs.read_buffer = NULL; + } gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer); gpr_slice_buffer_add(&stream_state->rs.read_slice_buffer, read_data_slice); From 0814e3cb179513a1ef96141f51e410416c2fea62 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 30 Sep 2016 16:28:24 -0700 Subject: [PATCH 055/123] Minor fixes --- src/core/ext/transport/cronet/transport/cronet_transport.c | 4 ++-- src/objective-c/ProtoRPC/ProtoService.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 6d5fe318ccb..6b0ed12b1e7 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -566,10 +566,10 @@ static void convert_metadata_to_cronet_headers( } if (mdelem->key == GRPC_MDSTR_METHOD) { if (mdelem->value == GRPC_MDSTR_PUT) { - *method = (const char*)mdelem->value->slice.data.refcounted.bytes; + *method = "PUT"; } else { /* POST method in default*/ - *method = (const char*)(GRPC_MDSTR_POST->slice.data.refcounted.bytes); + *method = "POST"; } continue; } diff --git a/src/objective-c/ProtoRPC/ProtoService.h b/src/objective-c/ProtoRPC/ProtoService.h index 5a19fb35db0..7faae1b49c9 100644 --- a/src/objective-c/ProtoRPC/ProtoService.h +++ b/src/objective-c/ProtoRPC/ProtoService.h @@ -32,7 +32,6 @@ */ #import -#import "ProtoRPC.h" @class GRPCProtoCall; @protocol GRXWriteable; From 20f49619ad4fc1f7ca25e72f4ff5527971186e68 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 30 Sep 2016 16:51:58 -0700 Subject: [PATCH 056/123] Simplify the changes using macro --- .../cronet/transport/cronet_transport.c | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 1a731f5885c..90f18e413d6 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -57,6 +57,14 @@ if (grpc_cronet_trace) gpr_log(__VA_ARGS__); \ } while (0) +#define free_read_buffer(state_rs) \ + if ((state_rs).read_buffer && \ + (state_rs).read_buffer != (state_rs).grpc_header_bytes) { \ + gpr_free((state_rs).read_buffer); \ + (state_rs).read_buffer = NULL; \ + } + + /* TODO (makdharma): Hook up into the wider tracing mechanism */ int grpc_cronet_trace = 0; @@ -341,11 +349,7 @@ static void on_failed(cronet_bidirectional_stream *stream, int net_error) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } - if (s->state.rs.read_buffer && - s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { - gpr_free(s->state.rs.read_buffer); - s->state.rs.read_buffer = NULL; - } + free_read_buffer(s->state.rs); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -368,11 +372,7 @@ static void on_canceled(cronet_bidirectional_stream *stream) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } - if (s->state.rs.read_buffer && - s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { - gpr_free(s->state.rs.read_buffer); - s->state.rs.read_buffer = NULL; - } + free_read_buffer(s->state.rs); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -387,11 +387,7 @@ static void on_succeeded(cronet_bidirectional_stream *stream) { cronet_bidirectional_stream_destroy(s->cbs); s->state.state_callback_received[OP_SUCCEEDED] = true; s->cbs = NULL; - if (s->state.rs.read_buffer && - s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { - gpr_free(s->state.rs.read_buffer); - s->state.rs.read_buffer = NULL; - } + free_read_buffer(s->state.rs); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -916,11 +912,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, uint8_t *dst_p = GPR_SLICE_START_PTR(read_data_slice); memcpy(dst_p, stream_state->rs.read_buffer, (size_t)stream_state->rs.length_field); - if (stream_state.rs.read_buffer && - stream_state.rs.read_buffer != stream_state.rs.grpc_header_bytes) { - gpr_free(stream_state.rs.read_buffer); - stream_state.rs.read_buffer = NULL; - } + free_read_buffer(stream_state->rs); gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer); gpr_slice_buffer_add(&stream_state->rs.read_slice_buffer, read_data_slice); From 9f85272dd378165344287a36d3547d0472ee626d Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Fri, 30 Sep 2016 14:47:15 -0700 Subject: [PATCH 057/123] bugfixes from integration testing --- src/core/ext/lb_policy/grpclb/grpclb.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index b9307d18662..1eafd2c961f 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -578,7 +578,7 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx, &addr_strs[addr_index++], (const struct sockaddr *)&args->addresses->addresses[i] .address.addr, - true) == 0); + true) > 0); } } } @@ -649,7 +649,6 @@ static void glb_shutdown(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { *pp->target = NULL; grpc_exec_ctx_sched(exec_ctx, &pp->wrapped_on_complete, GRPC_ERROR_NONE, NULL); - gpr_free(pp); pp = next; } @@ -692,7 +691,6 @@ static void glb_cancel_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_exec_ctx_sched( exec_ctx, &pp->wrapped_on_complete, GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL); - gpr_free(pp); } else { pp->next = glb_policy->pending_picks; glb_policy->pending_picks = pp; @@ -725,7 +723,6 @@ static void glb_cancel_picks(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_exec_ctx_sched( exec_ctx, &pp->wrapped_on_complete, GRPC_ERROR_CREATE_REFERENCING("Pick Cancelled", &error, 1), NULL); - gpr_free(pp); } else { pp->next = glb_policy->pending_picks; glb_policy->pending_picks = pp; From 6c0b960a45915227410d417bee5965712331bcf9 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Sun, 2 Oct 2016 14:32:06 -0700 Subject: [PATCH 058/123] Name revision --- src/objective-c/GRPCClient/GRPCCall.h | 18 +++++++++--------- src/objective-c/GRPCClient/GRPCCall.m | 24 ++++++++++-------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/objective-c/GRPCClient/GRPCCall.h b/src/objective-c/GRPCClient/GRPCCall.h index 4b28cade42e..7645bb1d34a 100644 --- a/src/objective-c/GRPCClient/GRPCCall.h +++ b/src/objective-c/GRPCClient/GRPCCall.h @@ -155,15 +155,15 @@ typedef NS_ENUM(NSUInteger, GRPCErrorCode) { }; /** - * Flags for options of a gRPC call - * + * Safety remark of a gRPC method as defined in RFC 2616 Section 9.1 */ -typedef NS_ENUM(NSUInteger, GRPCCallAttr) { - GRPCCallAttrDefault = 0, - /** Signal that the call is idempotent */ - GRPCCallAttrIdempotentRequest = 1, - /** Signal that the call is cacheable. GRPC is free to use GET verb */ - GRPCCallAttrCacheableRequest = 2, +typedef NS_ENUM(NSUInteger, GRPCCallSafety) { + /** Signal that there is no guarantees on how the call affects the server state. */ + GRPCCallSafetyDefault = 0, + /** Signal that the call is idempotent. gRPC is free to use PUT verb. */ + GRPCCallSafetyIdempotentRequest = 1, + /** Signal that the call is cacheable and will not affect server state. gRPC is free to use GET verb. */ + GRPCCallSafetyCacheableRequest = 2, }; /** @@ -251,7 +251,7 @@ extern id const kGRPCTrailersKey; * Host parameter should not contain the scheme (http:// or https://), only the name or IP addr * and the port number, for example @"localhost:5050". */ -+ (void)setCallAttribute:(GRPCCallAttr)callAttr host:(NSString *)host path:(NSString *)path; ++ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path; // TODO(jcanizales): Let specify a deadline. As a category of GRXWriter? @end diff --git a/src/objective-c/GRPCClient/GRPCCall.m b/src/objective-c/GRPCClient/GRPCCall.m index 2c0b7799452..43204345f55 100644 --- a/src/objective-c/GRPCClient/GRPCCall.m +++ b/src/objective-c/GRPCClient/GRPCCall.m @@ -110,16 +110,16 @@ static NSMutableDictionary *callFlags; callFlags = [NSMutableDictionary dictionary]; } -+ (void)setCallAttribute:(GRPCCallAttr)callAttr host:(NSString *)host path:(NSString *)path { - NSString *hostAndPath = [NSString stringWithFormat:@"%@%@", host, path]; - switch (callAttr) { - case GRPCCallAttrDefault: ++ (void)setCallSafety:(GRPCCallSafety)callSafety host:(NSString *)host path:(NSString *)path { + NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path]; + switch (callSafety) { + case GRPCCallSafetyDefault: callFlags[hostAndPath] = @0; break; - case GRPCCallAttrIdempotentRequest: + case GRPCCallSafetyIdempotentRequest: callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST; break; - case GRPCCallAttrCacheableRequest: + case GRPCCallSafetyCacheableRequest: callFlags[hostAndPath] = @GRPC_INITIAL_METADATA_CACHEABLE_REQUEST; break; default: @@ -127,13 +127,9 @@ static NSMutableDictionary *callFlags; } } -+ (uint32_t)getCallFlag:(NSString *)host path:(NSString *)path { - NSString *hostAndPath = [NSString stringWithFormat:@"%@%@", host, path]; - if (nil != [callFlags objectForKey:hostAndPath]) { - return [callFlags[hostAndPath] intValue]; - } else { - return 0; - } ++ (uint32_t)callFlagsForHost:(NSString *)host path:(NSString *)path { + NSString *hostAndPath = [NSString stringWithFormat:@"%@/%@", host, path]; + return [callFlags[hostAndPath] intValue]; } - (instancetype)init { @@ -259,7 +255,7 @@ static NSMutableDictionary *callFlags; - (void)sendHeaders:(NSDictionary *)headers { // TODO(jcanizales): Add error handlers for async failures [_wrappedCall startBatchWithOperations:@[[[GRPCOpSendMetadata alloc] initWithMetadata:headers - flags:(uint32_t)[GRPCCall getCallFlag:_host path:_path] + flags:[GRPCCall callFlagsForHost:_host path:_path] handler:nil]]]; } From 88405f70c16ab7a7679bb189b321bb565764e829 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 3 Oct 2016 08:24:52 -0700 Subject: [PATCH 059/123] Centralized logic for choosing the right LB policy. --- src/core/ext/client_config/client_channel.c | 32 ++++++++++++++++--- .../ext/resolver/dns/native/dns_resolver.c | 11 ++----- .../ext/resolver/sockaddr/sockaddr_resolver.c | 8 ++--- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index feb4cbde7b5..31f435ef625 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -185,10 +185,34 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg, lb_policy_args.additional_args = grpc_resolver_result_get_lb_policy_args(chand->resolver_result); lb_policy_args.client_channel_factory = chand->client_channel_factory; - lb_policy = grpc_lb_policy_create( - exec_ctx, - grpc_resolver_result_get_lb_policy_name(chand->resolver_result), - &lb_policy_args); + + // Special case: If all of the addresses are balancer addresses, + // assume that we should use the grpclb policy, regardless of what the + // resolver actually specified. + const char* lb_policy_name = + grpc_resolver_result_get_lb_policy_name(chand->resolver_result); + bool found_backend_address = false; + for (size_t i = 0; i < lb_policy_args.addresses->num_addresses; ++i) { + if (!lb_policy_args.addresses->addresses[i].is_balancer) { + found_backend_address = true; + break; + } + } + if (!found_backend_address) { + if (lb_policy_name != NULL && strcmp(lb_policy_name, "grpclb") != 0) { + gpr_log(GPR_INFO, + "resolver requested LB policy %s but provided only balancer " + "addresses, no backend addresses -- forcing use of grpclb LB " + "policy", (lb_policy_name == NULL ? "(none)" : lb_policy_name)); + } + lb_policy_name = "grpclb"; + } + // Use pick_first if nothing was specified and we didn't select grpclb + // above. + if (lb_policy_name == NULL) lb_policy_name = "pick_first"; + + lb_policy = + grpc_lb_policy_create(exec_ctx, lb_policy_name, &lb_policy_args); if (lb_policy != NULL) { GRPC_LB_POLICY_REF(lb_policy, "config_change"); GRPC_ERROR_UNREF(state_error); diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index e8ac1b12ae8..3908547893b 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -61,8 +61,6 @@ typedef struct { char *name_to_resolve; /** default port to use */ char *default_port; - /** load balancing policy name */ - char *lb_policy_name; /** mutex guarding the rest of the state */ gpr_mu mu; @@ -181,7 +179,7 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg, } grpc_resolved_addresses_destroy(r->addresses); result = grpc_resolver_result_create(r->target_name, addresses, - r->lb_policy_name, NULL); + NULL /* lb_policy_name */, NULL); } else { gpr_timespec now = gpr_now(GPR_CLOCK_MONOTONIC); gpr_timespec next_try = gpr_backoff_step(&r->backoff_state, now); @@ -245,13 +243,11 @@ static void dns_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { gpr_free(r->target_name); gpr_free(r->name_to_resolve); gpr_free(r->default_port); - gpr_free(r->lb_policy_name); gpr_free(r); } static grpc_resolver *dns_create(grpc_resolver_args *args, - const char *default_port, - const char *lb_policy_name) { + const char *default_port) { if (0 != strcmp(args->uri->authority, "")) { gpr_log(GPR_ERROR, "authority based dns uri's not supported"); return NULL; @@ -272,7 +268,6 @@ static grpc_resolver *dns_create(grpc_resolver_args *args, r->default_port = gpr_strdup(default_port); gpr_backoff_init(&r->backoff_state, BACKOFF_MULTIPLIER, BACKOFF_JITTER, BACKOFF_MIN_SECONDS * 1000, BACKOFF_MAX_SECONDS * 1000); - r->lb_policy_name = gpr_strdup(lb_policy_name); return &r->base; } @@ -286,7 +281,7 @@ static void dns_factory_unref(grpc_resolver_factory *factory) {} static grpc_resolver *dns_factory_create_resolver( grpc_resolver_factory *factory, grpc_resolver_args *args) { - return dns_create(args, "https", "pick_first"); + return dns_create(args, "https"); } static char *dns_factory_get_default_host_name(grpc_resolver_factory *factory, diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index f232e0460b6..d8c18057f78 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -164,7 +164,7 @@ char *unix_get_default_authority(grpc_resolver_factory *factory, static void do_nothing(void *ignored) {} static grpc_resolver *sockaddr_create( - grpc_resolver_args *args, const char *default_lb_policy_name, + grpc_resolver_args *args, int parse(grpc_uri *uri, struct sockaddr_storage *dst, size_t *len)) { bool errors_found = false; sockaddr_resolver *r; @@ -198,10 +198,6 @@ static grpc_resolver *sockaddr_create( abort(); } - if (r->lb_policy_name == NULL) { - r->lb_policy_name = gpr_strdup(default_lb_policy_name); - } - path_slice = gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); gpr_slice_buffer_init(&path_parts); @@ -251,7 +247,7 @@ static void sockaddr_factory_unref(grpc_resolver_factory *factory) {} #define DECL_FACTORY(name) \ static grpc_resolver *name##_factory_create_resolver( \ grpc_resolver_factory *factory, grpc_resolver_args *args) { \ - return sockaddr_create(args, "pick_first", parse_##name); \ + return sockaddr_create(args, parse_##name); \ } \ static const grpc_resolver_factory_vtable name##_factory_vtable = { \ sockaddr_factory_ref, sockaddr_factory_unref, \ From 8739e806fcc0358a404ff7e752fddb49898be409 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 3 Oct 2016 09:41:31 -0700 Subject: [PATCH 060/123] Update test --- src/objective-c/tests/GRPCClientTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objective-c/tests/GRPCClientTests.m b/src/objective-c/tests/GRPCClientTests.m index ce6ceee586a..77640525d58 100644 --- a/src/objective-c/tests/GRPCClientTests.m +++ b/src/objective-c/tests/GRPCClientTests.m @@ -330,7 +330,7 @@ static GRPCProtoMethod *kUnaryCallMethod; GRPCCall *call = [[GRPCCall alloc] initWithHost:kHostAddress path:kUnaryCallMethod.HTTPPath requestsWriter:requestsWriter]; - [GRPCCall setCallAttribute:GRPCCallAttrIdempotentRequest host:kHostAddress path:kUnaryCallMethod.HTTPPath]; + [GRPCCall setCallSafety:GRPCCallSafetyIdempotentRequest host:kHostAddress path:kUnaryCallMethod.HTTPPath]; id responsesWriteable = [[GRXWriteable alloc] initWithValueHandler:^(NSData *value) { XCTAssertNotNil(value, @"nil value received as response."); From 92795c405c3961441182f29a9356cf589bb70190 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Mon, 3 Oct 2016 09:53:38 -0700 Subject: [PATCH 061/123] Update free_read_buffer with a function --- .../cronet/transport/cronet_transport.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 90f18e413d6..b95aba14e9a 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -57,14 +57,6 @@ if (grpc_cronet_trace) gpr_log(__VA_ARGS__); \ } while (0) -#define free_read_buffer(state_rs) \ - if ((state_rs).read_buffer && \ - (state_rs).read_buffer != (state_rs).grpc_header_bytes) { \ - gpr_free((state_rs).read_buffer); \ - (state_rs).read_buffer = NULL; \ - } - - /* TODO (makdharma): Hook up into the wider tracing mechanism */ int grpc_cronet_trace = 0; @@ -247,6 +239,14 @@ static const char *op_id_string(enum e_op_id i) { return "UNKNOWN"; } +static void free_read_buffer(stream_obj *s) { + if (s->state.rs.read_buffer && + s->state.rs.read_buffer != s->state.rs.grpc_header_bytes) { + gpr_free(s->state.rs.read_buffer); + s->state.rs.read_buffer = NULL; + } +} + /* Add a new stream op to op storage. */ @@ -349,7 +349,7 @@ static void on_failed(cronet_bidirectional_stream *stream, int net_error) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } - free_read_buffer(s->state.rs); + free_read_buffer(s); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -372,7 +372,7 @@ static void on_canceled(cronet_bidirectional_stream *stream) { gpr_free(s->state.ws.write_buffer); s->state.ws.write_buffer = NULL; } - free_read_buffer(s->state.rs); + free_read_buffer(s); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -387,7 +387,7 @@ static void on_succeeded(cronet_bidirectional_stream *stream) { cronet_bidirectional_stream_destroy(s->cbs); s->state.state_callback_received[OP_SUCCEEDED] = true; s->cbs = NULL; - free_read_buffer(s->state.rs); + free_read_buffer(s); gpr_mu_unlock(&s->mu); execute_from_storage(s); } @@ -912,7 +912,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, uint8_t *dst_p = GPR_SLICE_START_PTR(read_data_slice); memcpy(dst_p, stream_state->rs.read_buffer, (size_t)stream_state->rs.length_field); - free_read_buffer(stream_state->rs); + free_read_buffer(s); gpr_slice_buffer_init(&stream_state->rs.read_slice_buffer); gpr_slice_buffer_add(&stream_state->rs.read_slice_buffer, read_data_slice); From 6909922fdf504167dcf89c521eaf374a62705e20 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 3 Oct 2016 11:28:37 -0700 Subject: [PATCH 062/123] Change to use the max deadline across calls --- src/core/ext/lb_policy/grpclb/grpclb.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 1eafd2c961f..76cc08ecc9a 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -105,6 +105,7 @@ #include #include #include +#include #include "src/core/ext/client_config/client_channel_factory.h" #include "src/core/ext/client_config/lb_policy_factory.h" @@ -765,7 +766,10 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, glb_lb_policy *glb_policy = (glb_lb_policy *)pol; gpr_mu_lock(&glb_policy->mu); - glb_policy->deadline = pick_args->deadline; + /* use the longest deadline across incoming calls for the communication with + * the LB server */ + glb_policy->deadline = + gpr_time_max(pick_args->deadline, glb_policy->deadline); bool pick_done; if (glb_policy->rr_policy != NULL) { @@ -802,9 +806,9 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, pick_args->initial_metadata, pick_args->lb_token_mdelem_storage, GRPC_MDELEM_REF(glb_policy->wc_arg.lb_token)); } + } else { /* else, the pending pick will be registered and taken care of by the * pending pick list inside the RR policy (glb_policy->rr_policy) */ - } else { grpc_polling_entity_add_to_pollset_set(exec_ctx, pick_args->pollent, glb_policy->base.interested_parties); add_pending_pick(&glb_policy->pending_picks, pick_args, target, @@ -926,6 +930,7 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) { grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client); grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client); + /* the longest deadline across incoming calls */ lb_client->deadline = glb_policy->deadline; /* Note the following LB call progresses every time there's activity in \a From da0ec8222e89f4d72e57a63b919cbfbc7a6de2d5 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 3 Oct 2016 11:32:04 -0700 Subject: [PATCH 063/123] Add fake resolver for tests. --- Makefile | 2 + build.yaml | 2 + .../ext/resolver/sockaddr/sockaddr_resolver.c | 25 +- test/core/client_config/lb_policies_test.c | 6 +- test/core/end2end/fake_resolver.c | 229 ++++++++++++++++++ test/core/end2end/fake_resolver.h | 39 +++ test/cpp/grpclb/grpclb_test.cc | 4 +- tools/run_tests/sources_and_headers.json | 3 + .../grpc_test_util/grpc_test_util.vcxproj | 3 + .../grpc_test_util.vcxproj.filters | 6 + .../grpc_test_util_unsecure.vcxproj | 3 + .../grpc_test_util_unsecure.vcxproj.filters | 6 + 12 files changed, 301 insertions(+), 27 deletions(-) create mode 100644 test/core/end2end/fake_resolver.c create mode 100644 test/core/end2end/fake_resolver.h diff --git a/Makefile b/Makefile index b98380be48b..fc0c38f3c7f 100644 --- a/Makefile +++ b/Makefile @@ -3058,6 +3058,7 @@ LIBGRPC_TEST_UTIL_SRC = \ test/core/end2end/data/test_root_cert.c \ test/core/security/oauth2_utils.c \ test/core/end2end/cq_verifier.c \ + test/core/end2end/fake_resolver.c \ test/core/end2end/fixtures/http_proxy.c \ test/core/end2end/fixtures/proxy.c \ test/core/iomgr/endpoint_tests.c \ @@ -3225,6 +3226,7 @@ endif LIBGRPC_TEST_UTIL_UNSECURE_SRC = \ test/core/end2end/cq_verifier.c \ + test/core/end2end/fake_resolver.c \ test/core/end2end/fixtures/http_proxy.c \ test/core/end2end/fixtures/proxy.c \ test/core/iomgr/endpoint_tests.c \ diff --git a/build.yaml b/build.yaml index 4746cc1a489..9e8b4c33043 100644 --- a/build.yaml +++ b/build.yaml @@ -507,6 +507,7 @@ filegroups: build: test headers: - test/core/end2end/cq_verifier.h + - test/core/end2end/fake_resolver.h - test/core/end2end/fixtures/http_proxy.h - test/core/end2end/fixtures/proxy.h - test/core/iomgr/endpoint_tests.h @@ -520,6 +521,7 @@ filegroups: - test/core/util/slice_splitter.h src: - test/core/end2end/cq_verifier.c + - test/core/end2end/fake_resolver.c - test/core/end2end/fixtures/http_proxy.c - test/core/end2end/fixtures/proxy.c - test/core/iomgr/endpoint_tests.c diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index d8c18057f78..d17a166850d 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -51,8 +51,6 @@ typedef struct { grpc_resolver base; /** refcount */ gpr_refcount refs; - /** load balancing policy name */ - char *lb_policy_name; /** the path component of the uri passed in */ char *target_name; /** the addresses that we've 'resolved' */ @@ -123,7 +121,7 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, *r->target_result = grpc_resolver_result_create( r->target_name, grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */), - r->lb_policy_name, NULL); + NULL /* lb_policy_name */, NULL); grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL); r->next_completion = NULL; } @@ -133,7 +131,6 @@ static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { sockaddr_resolver *r = (sockaddr_resolver *)gr; gpr_mu_destroy(&r->mu); grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); - gpr_free(r->lb_policy_name); gpr_free(r->target_name); gpr_free(r); } @@ -180,24 +177,6 @@ static grpc_resolver *sockaddr_create( r = gpr_malloc(sizeof(sockaddr_resolver)); memset(r, 0, sizeof(*r)); - r->lb_policy_name = - gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy")); - const char *lb_enabled_qpart = - grpc_uri_get_query_arg(args->uri, "lb_enabled"); - /* anything other than "0" is interpreted as true */ - const bool lb_enabled = - (lb_enabled_qpart != NULL && (strcmp("0", lb_enabled_qpart) != 0)); - - if (r->lb_policy_name != NULL && strcmp("grpclb", r->lb_policy_name) == 0 && - !lb_enabled) { - /* we want grpclb but the "resolved" addresses aren't LB enabled. Bail - * out, as this is meant mostly for tests. */ - gpr_log(GPR_ERROR, - "Requested 'grpclb' LB policy but resolved addresses don't " - "support load balancing."); - abort(); - } - path_slice = gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); gpr_slice_buffer_init(&path_parts); @@ -214,7 +193,6 @@ static grpc_resolver *sockaddr_create( errors_found = true; } gpr_free(part_str); - r->addresses->addresses[i].is_balancer = lb_enabled; if (errors_found) break; } @@ -222,7 +200,6 @@ static grpc_resolver *sockaddr_create( gpr_slice_buffer_destroy(&path_parts); gpr_slice_unref(path_slice); if (errors_found) { - gpr_free(r->lb_policy_name); gpr_free(r->target_name); grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); gpr_free(r); diff --git a/test/core/client_config/lb_policies_test.c b/test/core/client_config/lb_policies_test.c index 0b9648b7e1c..fafff7bd69f 100644 --- a/test/core/client_config/lb_policies_test.c +++ b/test/core/client_config/lb_policies_test.c @@ -48,6 +48,7 @@ #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/end2end/cq_verifier.h" +#include "test/core/end2end/fake_resolver.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" @@ -508,7 +509,7 @@ void run_spec(const test_spec *spec) { /* Create client. */ servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports, f->num_servers, ",", NULL); - gpr_asprintf(&client_hostport, "ipv4:%s?lb_policy=round_robin", + gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin", servers_hostports_str); arg.type = GRPC_ARG_INTEGER; @@ -544,7 +545,7 @@ static grpc_channel *create_client(const servers_fixture *f) { servers_hostports_str = gpr_strjoin_sep((const char **)f->servers_hostports, f->num_servers, ",", NULL); - gpr_asprintf(&client_hostport, "ipv4:%s?lb_policy=round_robin", + gpr_asprintf(&client_hostport, "test:%s?lb_policy=round_robin", servers_hostports_str); arg.type = GRPC_ARG_INTEGER; @@ -874,6 +875,7 @@ int main(int argc, char **argv) { const size_t NUM_SERVERS = 4; grpc_test_init(argc, argv); + grpc_fake_resolver_init(); grpc_init(); grpc_tracer_set_enabled("round_robin", 1); diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c new file mode 100644 index 00000000000..9b5e01b2a88 --- /dev/null +++ b/test/core/end2end/fake_resolver.c @@ -0,0 +1,229 @@ +// +// Copyright 2016, 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. +// + +// This is similar to the sockaddr resolver, except that it supports a +// bunch of query args that are useful for dependency injection in tests. + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "src/core/ext/client_config/parse_address.h" +#include "src/core/ext/client_config/resolver_registry.h" +#include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/iomgr/resolve_address.h" +#include "src/core/lib/iomgr/unix_sockets_posix.h" +#include "src/core/lib/support/string.h" + +// +// fake_resolver +// + +typedef struct { + // base class -- must be first + grpc_resolver base; + + gpr_refcount refs; + + // passed-in parameters + char* target_name; // the path component of the uri passed in + grpc_lb_addresses* addresses; + char* lb_policy_name; + + // mutex guarding the rest of the state + gpr_mu mu; + // have we published? + bool published; + // pending next completion, or NULL + grpc_closure* next_completion; + // target result address for next completion + grpc_resolver_result** target_result; +} fake_resolver; + +static void fake_resolver_destroy(grpc_exec_ctx* exec_ctx, grpc_resolver* gr) { + fake_resolver* r = (fake_resolver*)gr; + gpr_mu_destroy(&r->mu); + gpr_free(r->target_name); + grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); + gpr_free(r->lb_policy_name); + gpr_free(r); +} + +static void fake_resolver_shutdown(grpc_exec_ctx* exec_ctx, + grpc_resolver* resolver) { + fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); + if (r->next_completion != NULL) { + *r->target_result = NULL; + grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL); + r->next_completion = NULL; + } + gpr_mu_unlock(&r->mu); +} + +static void fake_resolver_maybe_finish_next_locked(grpc_exec_ctx* exec_ctx, + fake_resolver* r) { + if (r->next_completion != NULL && !r->published) { + r->published = true; + *r->target_result = grpc_resolver_result_create( + r->target_name, + grpc_lb_addresses_copy(r->addresses, NULL /* user_data_copy */), + r->lb_policy_name, NULL /* lb_policy_args */); + grpc_exec_ctx_sched(exec_ctx, r->next_completion, GRPC_ERROR_NONE, NULL); + r->next_completion = NULL; + } +} + +static void fake_resolver_channel_saw_error(grpc_exec_ctx* exec_ctx, + grpc_resolver* resolver) { + fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); + r->published = false; + fake_resolver_maybe_finish_next_locked(exec_ctx, r); + gpr_mu_unlock(&r->mu); +} + +static void fake_resolver_next(grpc_exec_ctx* exec_ctx, grpc_resolver* resolver, + grpc_resolver_result** target_result, + grpc_closure* on_complete) { + fake_resolver* r = (fake_resolver*)resolver; + gpr_mu_lock(&r->mu); + GPR_ASSERT(!r->next_completion); + r->next_completion = on_complete; + r->target_result = target_result; + fake_resolver_maybe_finish_next_locked(exec_ctx, r); + gpr_mu_unlock(&r->mu); +} + +static const grpc_resolver_vtable fake_resolver_vtable = { + fake_resolver_destroy, fake_resolver_shutdown, + fake_resolver_channel_saw_error, fake_resolver_next}; + +// +// fake_resolver_factory +// + +static void fake_resolver_factory_ref(grpc_resolver_factory* factory) {} + +static void fake_resolver_factory_unref(grpc_resolver_factory* factory) {} + +static void do_nothing(void* ignored) {} + +static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory, + grpc_resolver_args* args) { + if (0 != strcmp(args->uri->authority, "")) { + gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", + args->uri->scheme); + return NULL; + } + fake_resolver* r = gpr_malloc(sizeof(fake_resolver)); + memset(r, 0, sizeof(*r)); + r->target_name = gpr_strdup(args->uri->path); + // Initialize LB policy name. + r->lb_policy_name = + gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy")); + if (r->lb_policy_name == NULL) { + r->lb_policy_name = gpr_strdup("pick_first"); + } + // Get lb_enabled arg. + const char* lb_enabled_qpart = + grpc_uri_get_query_arg(args->uri, "lb_enabled"); + // Anything other than "0" is interpreted as true. + const bool lb_enabled = + lb_enabled_qpart != NULL && strcmp("0", lb_enabled_qpart) != 0; + if (strcmp("grpclb", r->lb_policy_name) == 0 && !lb_enabled) { + // we want grpclb but the "resolved" addresses aren't LB enabled. Bail + // out, as this is meant mostly for tests. + gpr_log(GPR_ERROR, + "Requested 'grpclb' LB policy but resolved addresses don't " + "support load balancing."); + abort(); + } + // Construct addresses. + gpr_slice path_slice = + gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); + gpr_slice_buffer path_parts; + gpr_slice_buffer_init(&path_parts); + gpr_slice_split(path_slice, ",", &path_parts); + r->addresses = grpc_lb_addresses_create(path_parts.count); + bool errors_found = false; + for (size_t i = 0; i < r->addresses->num_addresses; i++) { + grpc_uri ith_uri = *args->uri; + char* part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); + ith_uri.path = part_str; + if (!parse_ipv4(&ith_uri, + (struct sockaddr_storage*)(&r->addresses->addresses[i] + .address.addr), + &r->addresses->addresses[i].address.len)) { + errors_found = true; + } + gpr_free(part_str); + r->addresses->addresses[i].is_balancer = lb_enabled; + if (errors_found) break; + } + gpr_slice_buffer_destroy(&path_parts); + gpr_slice_unref(path_slice); + if (errors_found) { + gpr_free(r->lb_policy_name); + gpr_free(r->target_name); + grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); + gpr_free(r); + return NULL; + } + gpr_ref_init(&r->refs, 1); + gpr_mu_init(&r->mu); + grpc_resolver_init(&r->base, &fake_resolver_vtable); + return &r->base; +} + +static char* fake_resolver_get_default_authority(grpc_resolver_factory* factory, + grpc_uri* uri) { + const char* path = uri->path; + if (path[0] == '/') ++path; + return gpr_strdup(path); +} + +static const grpc_resolver_factory_vtable fake_resolver_factory_vtable = { + fake_resolver_factory_ref, fake_resolver_factory_unref, + fake_resolver_create, fake_resolver_get_default_authority, "test"}; + +static grpc_resolver_factory fake_resolver_factory = { + &fake_resolver_factory_vtable}; + +void grpc_fake_resolver_init(void) { + grpc_register_resolver_type(&fake_resolver_factory); +} diff --git a/test/core/end2end/fake_resolver.h b/test/core/end2end/fake_resolver.h new file mode 100644 index 00000000000..7a30347f301 --- /dev/null +++ b/test/core/end2end/fake_resolver.h @@ -0,0 +1,39 @@ +// +// Copyright 2016, 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. +// + +#ifndef GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H +#define GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H + +#include "test/core/util/test_config.h" + +void grpc_fake_resolver_init(); + +#endif /* GRPC_TEST_CORE_END2END_FAKE_RESOLVER_H */ diff --git a/test/cpp/grpclb/grpclb_test.cc b/test/cpp/grpclb/grpclb_test.cc index bbb983fc09c..41fa36880a6 100644 --- a/test/cpp/grpclb/grpclb_test.cc +++ b/test/cpp/grpclb/grpclb_test.cc @@ -59,6 +59,7 @@ extern "C" { #include "src/core/lib/surface/channel.h" #include "src/core/lib/surface/server.h" #include "test/core/end2end/cq_verifier.h" +#include "test/core/end2end/fake_resolver.h" #include "test/core/util/port.h" #include "test/core/util/test_config.h" } @@ -633,7 +634,7 @@ static test_fixture setup_test_fixture(int lb_server_update_delay_ms) { gpr_thd_new(&tf.lb_server.tid, fork_lb_server, &tf.lb_server, &options); char *server_uri; - gpr_asprintf(&server_uri, "ipv4:%s?lb_policy=grpclb&lb_enabled=1", + gpr_asprintf(&server_uri, "test:%s?lb_policy=grpclb&lb_enabled=1", tf.lb_server.servers_hostport); setup_client(server_uri, &tf.client); gpr_free(server_uri); @@ -716,6 +717,7 @@ TEST(GrpclbTest, InvalidAddressInServerlist) {} int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); grpc_test_init(argc, argv); + grpc_fake_resolver_init(); grpc_init(); const auto result = RUN_ALL_TESTS(); grpc_shutdown(); diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 03bdcd42645..bbdb998df39 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -6881,6 +6881,7 @@ ], "headers": [ "test/core/end2end/cq_verifier.h", + "test/core/end2end/fake_resolver.h", "test/core/end2end/fixtures/http_proxy.h", "test/core/end2end/fixtures/proxy.h", "test/core/iomgr/endpoint_tests.h", @@ -6899,6 +6900,8 @@ "src": [ "test/core/end2end/cq_verifier.c", "test/core/end2end/cq_verifier.h", + "test/core/end2end/fake_resolver.c", + "test/core/end2end/fake_resolver.h", "test/core/end2end/fixtures/http_proxy.c", "test/core/end2end/fixtures/http_proxy.h", "test/core/end2end/fixtures/proxy.c", diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj index 21d9fc95296..b724c217ed4 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj @@ -176,6 +176,7 @@ + @@ -284,6 +285,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters index 09a32482cd6..92806fa04a2 100644 --- a/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util/grpc_test_util.vcxproj.filters @@ -19,6 +19,9 @@ test\core\end2end + + test\core\end2end + test\core\end2end\fixtures @@ -416,6 +419,9 @@ test\core\end2end + + test\core\end2end + test\core\end2end\fixtures diff --git a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj index 04d1e584b5c..7878683f9eb 100644 --- a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj @@ -148,6 +148,7 @@ + @@ -163,6 +164,8 @@ + + diff --git a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters index 0f7072aa61d..2b20ab32fee 100644 --- a/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.filters @@ -4,6 +4,9 @@ test\core\end2end + + test\core\end2end + test\core\end2end\fixtures @@ -45,6 +48,9 @@ test\core\end2end + + test\core\end2end + test\core\end2end\fixtures From 8725870c5822a8d2f96e275e46475594567d5ccd Mon Sep 17 00:00:00 2001 From: Dan Born Date: Mon, 3 Oct 2016 12:46:16 -0700 Subject: [PATCH 064/123] Fix Windows server --- src/core/lib/iomgr/tcp_server_windows.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/core/lib/iomgr/tcp_server_windows.c b/src/core/lib/iomgr/tcp_server_windows.c index 35faded993d..4ff05601fa8 100644 --- a/src/core/lib/iomgr/tcp_server_windows.c +++ b/src/core/lib/iomgr/tcp_server_windows.c @@ -121,9 +121,6 @@ grpc_error *grpc_tcp_server_create(grpc_closure *shutdown_complete, } static void finish_shutdown(grpc_exec_ctx *exec_ctx, grpc_tcp_server *s) { - gpr_mu_lock(&s->mu); - GPR_ASSERT(s->shutdown); - gpr_mu_unlock(&s->mu); if (s->shutdown_complete != NULL) { grpc_exec_ctx_sched(exec_ctx, s->shutdown_complete, GRPC_ERROR_NONE, NULL); } From b34b055a40e66c625dc6271081c4b1bf5efa25cb Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Mon, 3 Oct 2016 13:34:55 -0700 Subject: [PATCH 065/123] Code cleanup. --- .../ext/resolver/dns/native/dns_resolver.c | 3 -- .../ext/resolver/sockaddr/sockaddr_resolver.c | 39 ++++++---------- test/core/end2end/fake_resolver.c | 45 ++++++------------- 3 files changed, 28 insertions(+), 59 deletions(-) diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 3908547893b..fa33ffd7bd5 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -53,8 +53,6 @@ typedef struct { /** base class: must be first */ grpc_resolver base; - /** refcount */ - gpr_refcount refs; /** target name */ char *target_name; /** name to resolve (usually the same as target_name) */ @@ -260,7 +258,6 @@ static grpc_resolver *dns_create(grpc_resolver_args *args, // Create resolver. dns_resolver *r = gpr_malloc(sizeof(dns_resolver)); memset(r, 0, sizeof(*r)); - gpr_ref_init(&r->refs, 1); gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &dns_resolver_vtable); r->target_name = gpr_strdup(path); diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index d17a166850d..5bb665e4163 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -49,8 +49,6 @@ typedef struct { /** base class: must be first */ grpc_resolver base; - /** refcount */ - gpr_refcount refs; /** the path component of the uri passed in */ char *target_name; /** the addresses that we've 'resolved' */ @@ -163,53 +161,44 @@ static void do_nothing(void *ignored) {} static grpc_resolver *sockaddr_create( grpc_resolver_args *args, int parse(grpc_uri *uri, struct sockaddr_storage *dst, size_t *len)) { - bool errors_found = false; - sockaddr_resolver *r; - gpr_slice path_slice; - gpr_slice_buffer path_parts; - if (0 != strcmp(args->uri->authority, "")) { gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", args->uri->scheme); return NULL; } - - r = gpr_malloc(sizeof(sockaddr_resolver)); - memset(r, 0, sizeof(*r)); - - path_slice = + /* Construct addresses. */ + gpr_slice path_slice = gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); + gpr_slice_buffer path_parts; gpr_slice_buffer_init(&path_parts); - gpr_slice_split(path_slice, ",", &path_parts); - r->addresses = grpc_lb_addresses_create(path_parts.count); - for (size_t i = 0; i < r->addresses->num_addresses; i++) { + grpc_lb_addresses *addresses = grpc_lb_addresses_create(path_parts.count); + bool errors_found = false; + for (size_t i = 0; i < addresses->num_addresses; i++) { grpc_uri ith_uri = *args->uri; char *part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); ith_uri.path = part_str; - if (!parse(&ith_uri, (struct sockaddr_storage *)(&r->addresses->addresses[i] + if (!parse(&ith_uri, (struct sockaddr_storage *)(&addresses->addresses[i] .address.addr), - &r->addresses->addresses[i].address.len)) { + &addresses->addresses[i].address.len)) { errors_found = true; } gpr_free(part_str); if (errors_found) break; } - - r->target_name = gpr_strdup(args->uri->path); gpr_slice_buffer_destroy(&path_parts); gpr_slice_unref(path_slice); if (errors_found) { - gpr_free(r->target_name); - grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); - gpr_free(r); + grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */); return NULL; } - - gpr_ref_init(&r->refs, 1); + /* Instantiate resolver. */ + sockaddr_resolver *r = gpr_malloc(sizeof(sockaddr_resolver)); + memset(r, 0, sizeof(*r)); + r->target_name = gpr_strdup(args->uri->path); + r->addresses = addresses; gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &sockaddr_resolver_vtable); - return &r->base; } diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c index 9b5e01b2a88..1f7b4b60f57 100644 --- a/test/core/end2end/fake_resolver.c +++ b/test/core/end2end/fake_resolver.c @@ -57,8 +57,6 @@ typedef struct { // base class -- must be first grpc_resolver base; - gpr_refcount refs; - // passed-in parameters char* target_name; // the path component of the uri passed in grpc_lb_addresses* addresses; @@ -150,61 +148,46 @@ static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory, args->uri->scheme); return NULL; } - fake_resolver* r = gpr_malloc(sizeof(fake_resolver)); - memset(r, 0, sizeof(*r)); - r->target_name = gpr_strdup(args->uri->path); - // Initialize LB policy name. - r->lb_policy_name = - gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy")); - if (r->lb_policy_name == NULL) { - r->lb_policy_name = gpr_strdup("pick_first"); - } - // Get lb_enabled arg. + // Get lb_enabled arg. Anything other than "0" is interpreted as true. const char* lb_enabled_qpart = grpc_uri_get_query_arg(args->uri, "lb_enabled"); - // Anything other than "0" is interpreted as true. const bool lb_enabled = lb_enabled_qpart != NULL && strcmp("0", lb_enabled_qpart) != 0; - if (strcmp("grpclb", r->lb_policy_name) == 0 && !lb_enabled) { - // we want grpclb but the "resolved" addresses aren't LB enabled. Bail - // out, as this is meant mostly for tests. - gpr_log(GPR_ERROR, - "Requested 'grpclb' LB policy but resolved addresses don't " - "support load balancing."); - abort(); - } // Construct addresses. gpr_slice path_slice = gpr_slice_new(args->uri->path, strlen(args->uri->path), do_nothing); gpr_slice_buffer path_parts; gpr_slice_buffer_init(&path_parts); gpr_slice_split(path_slice, ",", &path_parts); - r->addresses = grpc_lb_addresses_create(path_parts.count); + grpc_lb_addresses* addresses = grpc_lb_addresses_create(path_parts.count); bool errors_found = false; - for (size_t i = 0; i < r->addresses->num_addresses; i++) { + for (size_t i = 0; i < addresses->num_addresses; i++) { grpc_uri ith_uri = *args->uri; char* part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); ith_uri.path = part_str; if (!parse_ipv4(&ith_uri, - (struct sockaddr_storage*)(&r->addresses->addresses[i] + (struct sockaddr_storage*)(&addresses->addresses[i] .address.addr), - &r->addresses->addresses[i].address.len)) { + &addresses->addresses[i].address.len)) { errors_found = true; } gpr_free(part_str); - r->addresses->addresses[i].is_balancer = lb_enabled; + addresses->addresses[i].is_balancer = lb_enabled; if (errors_found) break; } gpr_slice_buffer_destroy(&path_parts); gpr_slice_unref(path_slice); if (errors_found) { - gpr_free(r->lb_policy_name); - gpr_free(r->target_name); - grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); - gpr_free(r); + grpc_lb_addresses_destroy(addresses, NULL /* user_data_destroy */); return NULL; } - gpr_ref_init(&r->refs, 1); + // Instantiate resolver. + fake_resolver* r = gpr_malloc(sizeof(fake_resolver)); + memset(r, 0, sizeof(*r)); + r->target_name = gpr_strdup(args->uri->path); + r->addresses = addresses; + r->lb_policy_name = + gpr_strdup(grpc_uri_get_query_arg(args->uri, "lb_policy")); gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &fake_resolver_vtable); return &r->base; From 5cf3c372ddafee6ee907e2b709e907d1dcd17f51 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 3 Oct 2016 14:30:03 -0700 Subject: [PATCH 066/123] Back to using inf future lor LB call deadline --- src/core/ext/client_config/client_channel.c | 4 +++- src/core/ext/client_config/lb_policy.h | 2 +- src/core/ext/lb_policy/grpclb/grpclb.c | 8 ++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index 0c1b2445bfb..3133869e22c 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -602,9 +602,11 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, int r; GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel"); gpr_mu_unlock(&chand->mu); + // TODO(dgq): use deadline for service config instead of inf_future for the + // pick's deadline. const grpc_lb_policy_pick_args inputs = { calld->pollent, initial_metadata, initial_metadata_flags, - &calld->lb_token_mdelem, calld->deadline}; + &calld->lb_token_mdelem, gpr_inf_future(GPR_CLOCK_MONOTONIC)}; r = grpc_lb_policy_pick(exec_ctx, lb_policy, &inputs, connected_subchannel, NULL, on_ready); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "pick_subchannel"); diff --git a/src/core/ext/client_config/lb_policy.h b/src/core/ext/client_config/lb_policy.h index 376bb2da631..6cc3e1ebd38 100644 --- a/src/core/ext/client_config/lb_policy.h +++ b/src/core/ext/client_config/lb_policy.h @@ -65,7 +65,7 @@ typedef struct grpc_lb_policy_pick_args { uint32_t initial_metadata_flags; /** Storage for LB token in \a initial_metadata, or NULL if not used */ grpc_linked_mdelem *lb_token_mdelem_storage; - /** Deadline associated with the picking call. */ + /** Deadline for the call to the LB server */ gpr_timespec deadline; } grpc_lb_policy_pick_args; diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 76cc08ecc9a..63af774ea6d 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -275,7 +275,7 @@ typedef struct glb_lb_policy { const char *server_name; grpc_client_channel_factory *cc_factory; - /** deadline for the original client's call */ + /** deadline for the LB's call */ gpr_timespec deadline; /** for communicating with the LB server */ @@ -766,10 +766,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, glb_lb_policy *glb_policy = (glb_lb_policy *)pol; gpr_mu_lock(&glb_policy->mu); - /* use the longest deadline across incoming calls for the communication with - * the LB server */ - glb_policy->deadline = - gpr_time_max(pick_args->deadline, glb_policy->deadline); + glb_policy->deadline = pick_args->deadline; bool pick_done; if (glb_policy->rr_policy != NULL) { @@ -930,7 +927,6 @@ static lb_client_data *lb_client_data_create(glb_lb_policy *glb_policy) { grpc_closure_init(&lb_client->close_sent, close_sent_cb, lb_client); grpc_closure_init(&lb_client->srv_status_rcvd, srv_status_rcvd_cb, lb_client); - /* the longest deadline across incoming calls */ lb_client->deadline = glb_policy->deadline; /* Note the following LB call progresses every time there's activity in \a From 61c5801465b4b81fe075e3282785d861d3f717c0 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 3 Oct 2016 14:44:20 -0700 Subject: [PATCH 067/123] improved todo --- src/core/ext/client_config/client_channel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index 3133869e22c..3b4747bebcf 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -602,8 +602,7 @@ static bool pick_subchannel(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, int r; GRPC_LB_POLICY_REF(lb_policy, "pick_subchannel"); gpr_mu_unlock(&chand->mu); - // TODO(dgq): use deadline for service config instead of inf_future for the - // pick's deadline. + // TODO(dgq): make this deadline configurable somehow. const grpc_lb_policy_pick_args inputs = { calld->pollent, initial_metadata, initial_metadata_flags, &calld->lb_token_mdelem, gpr_inf_future(GPR_CLOCK_MONOTONIC)}; From af42900b3dc26672dc393c2eb3ea56fec9e0d960 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Tue, 4 Oct 2016 00:49:05 -0700 Subject: [PATCH 068/123] generate_projects.sh out of sync on master --- tools/run_tests/sources_and_headers.json | 1 + tools/run_tests/tests.json | 42 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 9492bcffda0..a760e0986aa 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -361,6 +361,7 @@ "grpc_test_util" ], "headers": [], + "is_filegroup": false, "language": "c", "name": "dns_resolver_connectivity_test", "src": [ diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 65b227e2b82..c3395067c94 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -31479,6 +31479,27 @@ "posix" ] }, + { + "args": [ + "--scenarios_json", + "{\"scenarios\": [{\"name\": \"cpp_generic_async_streaming_ping_pong_secure\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 1, \"core_limit\": 1, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"server_type\": \"ASYNC_GENERIC_SERVER\"}, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"STREAMING\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}, \"num_clients\": 1}]}" + ], + "boringssl": true, + "ci_platforms": [ + "linux" + ], + "cpu_cost": 2, + "defaults": "boringssl", + "exclude_configs": [], + "flaky": false, + "language": "c++", + "name": "json_run_localhost", + "platforms": [ + "linux" + ], + "shortname": "json_run_localhost:cpp_generic_async_streaming_ping_pong_secure", + "timeout_seconds": 180 + }, { "args": [ "--scenarios_json", @@ -31689,6 +31710,27 @@ "shortname": "json_run_localhost:cpp_protobuf_async_streaming_qps_unconstrained_secure", "timeout_seconds": 180 }, + { + "args": [ + "--scenarios_json", + "{\"scenarios\": [{\"name\": \"cpp_generic_async_streaming_ping_pong_insecure\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 1, \"core_limit\": 1, \"security_params\": null, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"server_type\": \"ASYNC_GENERIC_SERVER\"}, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"STREAMING\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}, \"num_clients\": 1}]}" + ], + "boringssl": true, + "ci_platforms": [ + "linux" + ], + "cpu_cost": 2, + "defaults": "boringssl", + "exclude_configs": [], + "flaky": false, + "language": "c++", + "name": "json_run_localhost", + "platforms": [ + "linux" + ], + "shortname": "json_run_localhost:cpp_generic_async_streaming_ping_pong_insecure", + "timeout_seconds": 180 + }, { "args": [ "--scenarios_json", From 6bc086102e4b681672070ecff9cc0b769604b6a8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 11:52:32 +0200 Subject: [PATCH 069/123] fixes for run_tests_in_workspace.sh --- tools/run_tests/run_tests_in_workspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh index b0c9ad05f76..98ef3566db1 100755 --- a/tools/run_tests/run_tests_in_workspace.sh +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -42,5 +42,5 @@ rm -rf "${WORKSPACE_NAME}" git clone --recursive . "${WORKSPACE_NAME}" echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" -"${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ +python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ From 0b6d72c2961af504d7e40f3ac0a4238cd2ba82b5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 15:08:36 +0200 Subject: [PATCH 070/123] remove node portability targets --- tools/run_tests/run_tests_matrix.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index d5f90478257..a94f9cfef5e 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -195,15 +195,6 @@ def _create_portability_test_jobs(extra_args=[]): compiler='coreclr', labels=['portability'], extra_args=extra_args) - - for compiler in ['node5', 'node0.12']: - test_jobs += _generate_jobs(languages=['node'], - configs=['dbg'], - platforms=['linux'], - arch='default', - compiler=compiler, - labels=['portability'], - extra_args=extra_args) return test_jobs From aa44062271a0009c4148ec32b92109263b2a7549 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 17:52:15 +0200 Subject: [PATCH 071/123] add proxy script for run_tests_matrix.py --- tools/jenkins/run_jenkins_matrix.sh | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tools/jenkins/run_jenkins_matrix.sh diff --git a/tools/jenkins/run_jenkins_matrix.sh b/tools/jenkins/run_jenkins_matrix.sh new file mode 100755 index 00000000000..b3783e69584 --- /dev/null +++ b/tools/jenkins/run_jenkins_matrix.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Copyright 2015, 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. +# +# This script is invoked by Jenkins and triggers a test run, bypassing +# all args to the test script. +# +# Setting up rvm environment BEFORE we set -ex. +[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh +# To prevent cygwin bash complaining about empty lines ending with \r +# we set the igncr option. The option doesn't exist on Linux, so we fallback +# to just 'set -ex' there. +# NOTE: No empty lines should appear in this file before igncr is set! +set -ex -o igncr || set -ex + +python tools/run_tests/run_tests_matrix.py $@ From 274c8ed001aca0dc563ee7e04ecd2f9a486b77ec Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 4 Oct 2016 09:21:42 -0700 Subject: [PATCH 072/123] Fix handling of max receive message size on client side. --- src/core/lib/channel/message_size_filter.c | 14 +- src/core/lib/surface/call.c | 15 +- test/core/end2end/tests/max_message_length.c | 165 ++++++++++++++++++- 3 files changed, 179 insertions(+), 15 deletions(-) diff --git a/src/core/lib/channel/message_size_filter.c b/src/core/lib/channel/message_size_filter.c index 02fc68fc3ae..f067a3a51c9 100644 --- a/src/core/lib/channel/message_size_filter.c +++ b/src/core/lib/channel/message_size_filter.c @@ -73,16 +73,22 @@ static void recv_message_ready(grpc_exec_ctx* exec_ctx, void* user_data, gpr_asprintf(&message_string, "Received message larger than max (%u vs. %d)", (*calld->recv_message)->length, chand->max_recv_size); - gpr_slice message = gpr_slice_from_copied_string(message_string); + grpc_error* new_error = grpc_error_set_int( + GRPC_ERROR_CREATE(message_string), GRPC_ERROR_INT_GRPC_STATUS, + GRPC_STATUS_INVALID_ARGUMENT); + if (error == GRPC_ERROR_NONE) { + error = new_error; + } else { + error = grpc_error_add_child(error, new_error); + GRPC_ERROR_UNREF(new_error); + } gpr_free(message_string); - grpc_call_element_send_close_with_message( - exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, &message); } // Invoke the next callback. grpc_exec_ctx_sched(exec_ctx, calld->next_recv_message_ready, error, NULL); } -// Start transport op. +// Start transport stream op. static void start_transport_stream_op(grpc_exec_ctx* exec_ctx, grpc_call_element* elem, grpc_transport_stream_op* op) { diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 5690bcab1e4..b0f66f4f612 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1103,8 +1103,8 @@ static void receiving_slice_ready(grpc_exec_ctx *exec_ctx, void *bctlp, } } -static void process_data_after_md(grpc_exec_ctx *exec_ctx, batch_control *bctl, - bool success) { +static void process_data_after_md(grpc_exec_ctx *exec_ctx, + batch_control *bctl) { grpc_call *call = bctl->call; if (call->receiving_stream == NULL) { *call->receiving_buffer = NULL; @@ -1124,8 +1124,6 @@ static void process_data_after_md(grpc_exec_ctx *exec_ctx, batch_control *bctl, grpc_closure_init(&call->receiving_slice_ready, receiving_slice_ready, bctl); continue_receiving_slices(exec_ctx, bctl); - /* early out */ - return; } } @@ -1133,12 +1131,17 @@ static void receiving_stream_ready(grpc_exec_ctx *exec_ctx, void *bctlp, grpc_error *error) { batch_control *bctl = bctlp; grpc_call *call = bctl->call; - + if (error != GRPC_ERROR_NONE) { + grpc_status_code status; + const char *msg; + grpc_error_get_status(error, &status, &msg); + close_with_status(exec_ctx, call, status, msg); + } gpr_mu_lock(&bctl->call->mu); if (bctl->call->has_initial_md_been_received || error != GRPC_ERROR_NONE || call->receiving_stream == NULL) { gpr_mu_unlock(&bctl->call->mu); - process_data_after_md(exec_ctx, bctlp, error); + process_data_after_md(exec_ctx, bctlp); } else { call->saved_receiving_stream_ready_bctlp = bctlp; gpr_mu_unlock(&bctl->call->mu); diff --git a/test/core/end2end/tests/max_message_length.c b/test/core/end2end/tests/max_message_length.c index cdca3e67487..d27ccedb4e3 100644 --- a/test/core/end2end/tests/max_message_length.c +++ b/test/core/end2end/tests/max_message_length.c @@ -98,9 +98,12 @@ static void end_test(grpc_end2end_test_fixture *f) { grpc_completion_queue_destroy(f->cq); } -static void test_max_message_length(grpc_end2end_test_config config, - bool send_limit) { - gpr_log(GPR_INFO, "testing with send_limit=%d", send_limit); +// Test with request larger than the limit. +// If send_limit is true, applies send limit on client; otherwise, applies +// recv limit on server. +static void test_max_message_length_on_request(grpc_end2end_test_config config, + bool send_limit) { + gpr_log(GPR_INFO, "testing request with send_limit=%d", send_limit); grpc_end2end_test_fixture f; grpc_arg channel_arg; @@ -239,9 +242,161 @@ done: config.tear_down_data(&f); } +// Test with response larger than the limit. +// If send_limit is true, applies send limit on server; otherwise, applies +// recv limit on client. +static void test_max_message_length_on_response(grpc_end2end_test_config config, + bool send_limit) { + gpr_log(GPR_INFO, "testing response with send_limit=%d", send_limit); + + grpc_end2end_test_fixture f; + grpc_arg channel_arg; + grpc_channel_args channel_args; + grpc_call *c = NULL; + grpc_call *s = NULL; + cq_verifier *cqv; + grpc_op ops[6]; + grpc_op *op; + gpr_slice response_payload_slice = + gpr_slice_from_copied_string("hello world"); + grpc_byte_buffer *response_payload = + grpc_raw_byte_buffer_create(&response_payload_slice, 1); + grpc_byte_buffer *recv_payload = NULL; + 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; + char *details = NULL; + size_t details_capacity = 0; + int was_cancelled = 2; + + channel_arg.key = send_limit ? GRPC_ARG_MAX_SEND_MESSAGE_LENGTH + : GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH; + channel_arg.type = GRPC_ARG_INTEGER; + channel_arg.value.integer = 5; + + channel_args.num_args = 1; + channel_args.args = &channel_arg; + + f = begin_test(config, "test_max_message_length", + send_limit ? NULL : &channel_args, + send_limit ? &channel_args : NULL); + cqv = cq_verifier_create(f.cq); + + c = grpc_channel_create_call(f.client, NULL, GRPC_PROPAGATE_DEFAULTS, f.cq, + "/foo", "foo.test.google.fr:1234", + gpr_inf_future(GPR_CLOCK_REALTIME), 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->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 = &initial_metadata_recv; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_RECV_MESSAGE; + op->data.recv_message = &recv_payload; + 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->data.recv_status_on_client.status_details_capacity = &details_capacity; + 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); + + 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_RECV_CLOSE_ON_SERVER; + op->data.recv_close_on_server.cancelled = &was_cancelled; + op->flags = 0; + op->reserved = NULL; + op++; + op->op = GRPC_OP_SEND_MESSAGE; + op->data.send_message = response_payload; + 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_OK; + op->data.send_status_from_server.status_details = "xyz"; + 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); + + GPR_ASSERT(0 == strcmp(call_details.method, "/foo")); + GPR_ASSERT(0 == strcmp(call_details.host, "foo.test.google.fr:1234")); + GPR_ASSERT(was_cancelled == 0); + + GPR_ASSERT(status == GRPC_STATUS_INVALID_ARGUMENT); + GPR_ASSERT(strcmp(details, + send_limit + ? "Sent message larger than max (11 vs. 5)" + : "Received message larger than max (11 vs. 5)") == 0); + + gpr_free(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_byte_buffer_destroy(response_payload); + grpc_byte_buffer_destroy(recv_payload); + + grpc_call_destroy(c); + if (s != NULL) grpc_call_destroy(s); + + cq_verifier_destroy(cqv); + + end_test(&f); + config.tear_down_data(&f); +} + void max_message_length(grpc_end2end_test_config config) { - test_max_message_length(config, true); - test_max_message_length(config, false); + test_max_message_length_on_request(config, false /* send_limit */); + test_max_message_length_on_request(config, true /* send_limit */); + test_max_message_length_on_response(config, false /* send_limit */); + test_max_message_length_on_response(config, true /* send_limit */); } void max_message_length_pre_init(void) {} From 07aab59da9454c30b079849119562c58a40caa94 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 4 Oct 2016 10:02:00 -0700 Subject: [PATCH 073/123] clang-format --- src/core/ext/client_config/client_channel.c | 5 +++-- src/core/ext/resolver/sockaddr/sockaddr_resolver.c | 14 ++++++++------ test/core/end2end/fake_resolver.c | 8 ++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index f3befe9b478..51f6f8e4078 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -189,7 +189,7 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg, // Special case: If all of the addresses are balancer addresses, // assume that we should use the grpclb policy, regardless of what the // resolver actually specified. - const char* lb_policy_name = + const char *lb_policy_name = grpc_resolver_result_get_lb_policy_name(chand->resolver_result); bool found_backend_address = false; for (size_t i = 0; i < lb_policy_args.addresses->num_addresses; ++i) { @@ -203,7 +203,8 @@ static void on_resolver_result_changed(grpc_exec_ctx *exec_ctx, void *arg, gpr_log(GPR_INFO, "resolver requested LB policy %s but provided only balancer " "addresses, no backend addresses -- forcing use of grpclb LB " - "policy", (lb_policy_name == NULL ? "(none)" : lb_policy_name)); + "policy", + (lb_policy_name == NULL ? "(none)" : lb_policy_name)); } lb_policy_name = "grpclb"; } diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index 5bb665e4163..5a7a32d7cb7 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -158,9 +158,10 @@ char *unix_get_default_authority(grpc_resolver_factory *factory, static void do_nothing(void *ignored) {} -static grpc_resolver *sockaddr_create( - grpc_resolver_args *args, - int parse(grpc_uri *uri, struct sockaddr_storage *dst, size_t *len)) { +static grpc_resolver *sockaddr_create(grpc_resolver_args *args, + int parse(grpc_uri *uri, + struct sockaddr_storage *dst, + size_t *len)) { if (0 != strcmp(args->uri->authority, "")) { gpr_log(GPR_ERROR, "authority based uri's not supported by the %s scheme", args->uri->scheme); @@ -178,9 +179,10 @@ static grpc_resolver *sockaddr_create( grpc_uri ith_uri = *args->uri; char *part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); ith_uri.path = part_str; - if (!parse(&ith_uri, (struct sockaddr_storage *)(&addresses->addresses[i] - .address.addr), - &addresses->addresses[i].address.len)) { + if (!parse( + &ith_uri, + (struct sockaddr_storage *)(&addresses->addresses[i].address.addr), + &addresses->addresses[i].address.len)) { errors_found = true; } gpr_free(part_str); diff --git a/test/core/end2end/fake_resolver.c b/test/core/end2end/fake_resolver.c index 1f7b4b60f57..8a6624a49ab 100644 --- a/test/core/end2end/fake_resolver.c +++ b/test/core/end2end/fake_resolver.c @@ -165,10 +165,10 @@ static grpc_resolver* fake_resolver_create(grpc_resolver_factory* factory, grpc_uri ith_uri = *args->uri; char* part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); ith_uri.path = part_str; - if (!parse_ipv4(&ith_uri, - (struct sockaddr_storage*)(&addresses->addresses[i] - .address.addr), - &addresses->addresses[i].address.len)) { + if (!parse_ipv4( + &ith_uri, + (struct sockaddr_storage*)(&addresses->addresses[i].address.addr), + &addresses->addresses[i].address.len)) { errors_found = true; } gpr_free(part_str); From 95c7143704794912094e7f19e6c595af076a543a Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Tue, 4 Oct 2016 10:03:05 -0700 Subject: [PATCH 074/123] Ran generate_projects.sh. --- tools/run_tests/sources_and_headers.json | 1 + tools/run_tests/tests.json | 42 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1f6eaccb94c..ae5a9382c0b 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -361,6 +361,7 @@ "grpc_test_util" ], "headers": [], + "is_filegroup": false, "language": "c", "name": "dns_resolver_connectivity_test", "src": [ diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 65b227e2b82..c3395067c94 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -31479,6 +31479,27 @@ "posix" ] }, + { + "args": [ + "--scenarios_json", + "{\"scenarios\": [{\"name\": \"cpp_generic_async_streaming_ping_pong_secure\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 1, \"core_limit\": 1, \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"server_type\": \"ASYNC_GENERIC_SERVER\"}, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": {\"use_test_ca\": true, \"server_host_override\": \"foo.test.google.fr\"}, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"STREAMING\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}, \"num_clients\": 1}]}" + ], + "boringssl": true, + "ci_platforms": [ + "linux" + ], + "cpu_cost": 2, + "defaults": "boringssl", + "exclude_configs": [], + "flaky": false, + "language": "c++", + "name": "json_run_localhost", + "platforms": [ + "linux" + ], + "shortname": "json_run_localhost:cpp_generic_async_streaming_ping_pong_secure", + "timeout_seconds": 180 + }, { "args": [ "--scenarios_json", @@ -31689,6 +31710,27 @@ "shortname": "json_run_localhost:cpp_protobuf_async_streaming_qps_unconstrained_secure", "timeout_seconds": 180 }, + { + "args": [ + "--scenarios_json", + "{\"scenarios\": [{\"name\": \"cpp_generic_async_streaming_ping_pong_insecure\", \"warmup_seconds\": 0, \"benchmark_seconds\": 1, \"num_servers\": 1, \"server_config\": {\"async_server_threads\": 1, \"core_limit\": 1, \"security_params\": null, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"server_type\": \"ASYNC_GENERIC_SERVER\"}, \"client_config\": {\"client_type\": \"ASYNC_CLIENT\", \"security_params\": null, \"payload_config\": {\"bytebuf_params\": {\"resp_size\": 0, \"req_size\": 0}}, \"client_channels\": 1, \"async_client_threads\": 1, \"outstanding_rpcs_per_channel\": 1, \"rpc_type\": \"STREAMING\", \"load_params\": {\"closed_loop\": {}}, \"histogram_params\": {\"max_possible\": 60000000000.0, \"resolution\": 0.01}}, \"num_clients\": 1}]}" + ], + "boringssl": true, + "ci_platforms": [ + "linux" + ], + "cpu_cost": 2, + "defaults": "boringssl", + "exclude_configs": [], + "flaky": false, + "language": "c++", + "name": "json_run_localhost", + "platforms": [ + "linux" + ], + "shortname": "json_run_localhost:cpp_generic_async_streaming_ping_pong_insecure", + "timeout_seconds": 180 + }, { "args": [ "--scenarios_json", From 53ab32be86d0747af636070674f5830123c5a45c Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 4 Oct 2016 13:09:36 -0700 Subject: [PATCH 075/123] added missing line to UDP server --- src/core/lib/iomgr/udp_server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/lib/iomgr/udp_server.c b/src/core/lib/iomgr/udp_server.c index 12e929fa6a8..6650ef022df 100644 --- a/src/core/lib/iomgr/udp_server.c +++ b/src/core/lib/iomgr/udp_server.c @@ -199,6 +199,7 @@ void grpc_udp_server_destroy(grpc_exec_ctx *exec_ctx, grpc_udp_server *s, /* shutdown all fd's */ if (s->active_ports) { for (i = 0; i < s->nports; i++) { + server_port *sp = &s->ports[i]; /* Call the orphan_cb to signal that the FD is about to be closed and * should no longer be used. */ GPR_ASSERT(sp->orphan_cb); From 84350e167d4bc4f7c96af71baf28b5a5a0807856 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Tue, 4 Oct 2016 20:25:53 +0000 Subject: [PATCH 076/123] Drop unnecessary return statement --- src/python/grpcio/grpc/_server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 94a13bfb2fb..f70cd2afa55 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -462,7 +462,6 @@ def _unary_response_in_pool( rpc_event, state, response, response_serializer) if serialized_response is not None: _status(rpc_event, state, serialized_response) - return def _stream_response_in_pool( From f042481403cd35669f5efc7aff9b42036ab7f862 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 4 Oct 2016 13:29:52 -0700 Subject: [PATCH 077/123] s/std::string/grpc::string --- test/cpp/util/proto_file_parser.cc | 2 +- test/cpp/util/proto_reflection_descriptor_database.cc | 4 ++-- test/cpp/util/proto_reflection_descriptor_database.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc index 01acb015325..98dd3f14ad4 100644 --- a/test/cpp/util/proto_file_parser.cc +++ b/test/cpp/util/proto_file_parser.cc @@ -82,7 +82,7 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr channel, const grpc::string& proto_path, const grpc::string& protofiles) : has_error_(false) { - std::vector service_list; + std::vector service_list; if (channel) { reflection_db_.reset(new grpc::ProtoReflectionDescriptorDatabase(channel)); reflection_db_->GetServices(&service_list); diff --git a/test/cpp/util/proto_reflection_descriptor_database.cc b/test/cpp/util/proto_reflection_descriptor_database.cc index f0d14c686a3..b60f447e377 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.cc +++ b/test/cpp/util/proto_reflection_descriptor_database.cc @@ -255,7 +255,7 @@ bool ProtoReflectionDescriptorDatabase::FindAllExtensionNumbers( } bool ProtoReflectionDescriptorDatabase::GetServices( - std::vector* output) { + std::vector* output) { ServerReflectionRequest request; request.set_list_services(""); ServerReflectionResponse response; @@ -288,7 +288,7 @@ bool ProtoReflectionDescriptorDatabase::GetServices( const protobuf::FileDescriptorProto ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse( - const std::string& byte_fd_proto) { + const grpc::string& byte_fd_proto) { protobuf::FileDescriptorProto file_desc_proto; file_desc_proto.ParseFromString(byte_fd_proto); return file_desc_proto; diff --git a/test/cpp/util/proto_reflection_descriptor_database.h b/test/cpp/util/proto_reflection_descriptor_database.h index 0e69696d5fb..471c9618dad 100644 --- a/test/cpp/util/proto_reflection_descriptor_database.h +++ b/test/cpp/util/proto_reflection_descriptor_database.h @@ -95,7 +95,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase { std::vector* output) GRPC_OVERRIDE; // Provide a list of full names of registered services - bool GetServices(std::vector* output); + bool GetServices(std::vector* output); private: typedef ClientReaderWriter< @@ -104,7 +104,7 @@ class ProtoReflectionDescriptorDatabase : public protobuf::DescriptorDatabase { ClientStream; const protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse( - const std::string& byte_fd_proto); + const grpc::string& byte_fd_proto); void AddFileFromResponse( const grpc::reflection::v1alpha::FileDescriptorResponse& response); From e5b4c26ef7d1a695f8d925b1d4d481853c98f188 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Tue, 4 Oct 2016 13:44:18 -0700 Subject: [PATCH 078/123] more usage of std::string --- test/cpp/end2end/proto_server_reflection_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cpp/end2end/proto_server_reflection_test.cc b/test/cpp/end2end/proto_server_reflection_test.cc index efbb0e1f8e5..75efd01f066 100644 --- a/test/cpp/end2end/proto_server_reflection_test.cc +++ b/test/cpp/end2end/proto_server_reflection_test.cc @@ -144,7 +144,7 @@ class ProtoServerReflectionTest : public ::testing::Test { TEST_F(ProtoServerReflectionTest, CheckResponseWithLocalDescriptorPool) { ResetStub(); - std::vector services; + std::vector services; desc_db_->GetServices(&services); // The service list has at least one service (reflection servcie). EXPECT_TRUE(services.size() > 0); From 3b0d092e22a30d449952be210b174cb9d080b462 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 14:33:18 +0200 Subject: [PATCH 079/123] add matrix run script --- tools/run_tests/run_tests_in_workspace.sh | 44 ++++ tools/run_tests/run_tests_matrix.py | 239 ++++++++++++++++++++++ 2 files changed, 283 insertions(+) create mode 100755 tools/run_tests/run_tests_in_workspace.sh create mode 100755 tools/run_tests/run_tests_matrix.py diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh new file mode 100755 index 00000000000..0e7604dbc55 --- /dev/null +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2015, 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. +# +# Create a workspace in a subdirectory to allow running multiple builds in isolation. +# WORKSPACE_NAME env variable needs to contain name of the workspace to create. +# All cmdline args will be passed to run_tests.py script (executed in the +# newly created workspace) +set -ex + +cd $(dirname $0)/../.. + +rm -rf "${WORKSPACE_NAME}" +git clone --recursive . "${WORKSPACE_NAME}" + +echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" +"${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ + diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py new file mode 100755 index 00000000000..2344e2f9fd8 --- /dev/null +++ b/tools/run_tests/run_tests_matrix.py @@ -0,0 +1,239 @@ +#!/usr/bin/env python2.7 +# Copyright 2015, 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. + +"""Run test matrix.""" + +import argparse +import jobset +import os +import report_utils +import sys + +_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) +os.chdir(_ROOT) + +# TODO(jtattermusch): this is not going to be enough for sanitizers. +_RUNTESTS_TIMEOUT = 30*60 + + +def _docker_jobspec(name, runtests_args=[]): + """Run a single instance of run_tests.py in a docker container""" + # TODO: fix copying report files from inside docker.... + test_job = jobset.JobSpec( + cmdline=['python', 'tools/run_tests/run_tests.py', + '--use_docker', + '-t', + '-j', '3', + '-x', 'report_%s.xml' % name] + runtests_args, + shortname='run_tests_%s' % name, + timeout_seconds=_RUNTESTS_TIMEOUT) + return test_job + + +def _workspace_jobspec(name, runtests_args=[], workspace_name=None): + """Run a single instance of run_tests.py in a separate workspace""" + env = {'WORKSPACE_NAME': workspace_name} + test_job = jobset.JobSpec( + cmdline=['tools/run_tests/run_tests_in_workspace.sh', + '-t', + '-j', '3', + '-x', '../report_%s.xml' % name] + runtests_args, + environ=env, + shortname='run_tests_%s' % name, + timeout_seconds=_RUNTESTS_TIMEOUT) + return test_job + + +def _generate_jobs(languages, configs, platforms, + arch=None, compiler=None, + labels=[]): + result = [] + for language in languages: + for platform in platforms: + for config in configs: + name = '%s_%s_%s' % (language, platform, config) + runtests_args = ['-l', language, + '-c', config] + if arch or compiler: + name += '_%s_%s' % (arch, compiler) + runtests_args += ['--arch', arch, + '--compiler', compiler] + + if platform == 'linux': + job = _docker_jobspec(name=name, runtests_args=runtests_args) + else: + job = _workspace_jobspec(name=name, runtests_args=runtests_args) + + job.labels = [platform, config, language] + labels + result.append(job) + return result + + +def _create_test_jobs(): + test_jobs = [] + # supported on linux only + test_jobs += _generate_jobs(languages=['sanity', 'php7'], + configs=['dbg', 'opt'], + platforms=['linux'], + labels=['basictests']) + + # supported on all platforms. + test_jobs += _generate_jobs(languages=['c', 'csharp', 'node', 'python'], + configs=['dbg', 'opt'], + platforms=['linux', 'macos', 'windows'], + labels=['basictests']) + + # supported on linux and mac. + test_jobs += _generate_jobs(languages=['c++', 'ruby', 'php'], + configs=['dbg', 'opt'], + platforms=['linux', 'macos'], + labels=['basictests']) + + # supported on mac only. + test_jobs += _generate_jobs(languages=['objc'], + configs=['dbg', 'opt'], + platforms=['macos'], + labels=['basictests']) + + # sanitizers + test_jobs += _generate_jobs(languages=['c'], + configs=['msan', 'asan', 'tsan'], + platforms=['linux'], + labels=['sanitizers']) + test_jobs += _generate_jobs(languages=['c++'], + configs=['asan', 'tsan'], + platforms=['linux'], + labels=['sanitizers']) + return test_jobs + + +def _create_portability_test_jobs(): + test_jobs = [] + # portability C x86 + test_jobs += _generate_jobs(languages=['c'], + configs=['dbg'], + platforms=['linux'], + arch='x86', + compiler='default', + labels=['portability']) + + # portability C and C++ on x64 + for compiler in ['gcc4.4', 'gcc4.6', 'gcc5.3', + 'clang3.5', 'clang3.6', 'clang3.7']: + test_jobs += _generate_jobs(languages=['c', 'c++'], + configs=['dbg'], + platforms=['linux'], + arch='x64', + compiler=compiler, + labels=['portability']) + + # portability C on Windows + for arch in ['x86', 'x64']: + for compiler in ['vs2013', 'vs2015']: + test_jobs += _generate_jobs(languages=['c'], + configs=['dbg'], + platforms=['windows'], + arch=arch, + compiler=compiler, + labels=['portability']) + + test_jobs += _generate_jobs(languages=['python'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler='python3.4', + labels=['portability']) + + test_jobs += _generate_jobs(languages=['csharp'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler='coreclr', + labels=['portability']) + + for compiler in ['node5', 'node6', 'node0.12']: + test_jobs += _generate_jobs(languages=['node'], + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler=compiler, + labels=['portability']) + return test_jobs + + +all_jobs = _create_test_jobs() + _create_portability_test_jobs() + +all_labels = set() +for job in all_jobs: + for label in job.labels: + all_labels.add(label) + +argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +argp.add_argument('-f', '--filter', + choices=sorted(all_labels), + nargs='+', + default=[], + help='Filter targets to run by label with AND semantics.') +args = argp.parse_args() + +jobs = [] +for job in all_jobs: + if not args.filter or all(filter in job.labels for filter in args.filter): + jobs.append(job) + +if not jobs: + jobset.message('FAILED', 'No test suites match given criteria.', + do_newline=True) + sys.exit(1) + +print('IMPORTANT: The changes you are testing need to be locally committed') +print('because only the committed changes in the current branch will be') +print('copied to the docker environment or into subworkspaces.') + +print +print 'Will run these tests:' +for job in jobs: + print ' %s' % job.shortname +print + +jobset.message('START', 'Running test matrix.', do_newline=True) +num_failures, resultset = jobset.run(jobs, + newline_on_success=True, + travis=True, + maxjobs=2) +report_utils.render_junit_xml_report(resultset, 'report.xml') + +if num_failures == 0: + jobset.message('SUCCESS', 'All run_tests.py instance finished successfully.', + do_newline=True) +else: + jobset.message('FAILED', 'Some run_tests.py instance have failed.', + do_newline=True) + sys.exit(1) From 0b19470d2b6ec821aa504ce615ba9f9d68596d28 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 18:20:37 +0200 Subject: [PATCH 080/123] improve report collection --- tools/run_tests/dockerize/docker_run_tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/dockerize/docker_run_tests.sh b/tools/run_tests/dockerize/docker_run_tests.sh index 8c6143d24f9..ef02d266253 100755 --- a/tools/run_tests/dockerize/docker_run_tests.sh +++ b/tools/run_tests/dockerize/docker_run_tests.sh @@ -63,6 +63,7 @@ echo '' >> index.html cd .. zip -r reports.zip reports -find . -name report.xml | xargs zip reports.zip +find . -name report.xml | xargs -r zip reports.zip +find . -name 'report_*.xml' | xargs -r zip reports.zip exit $exit_code From 7a7792a9de680c9d6925b092d5efbf17984feec5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 19 Sep 2016 18:37:17 +0200 Subject: [PATCH 081/123] run matrix improvements --- .../dockerize/build_docker_and_run_tests.sh | 12 ++++++------ tools/run_tests/run_tests_in_workspace.sh | 2 ++ tools/run_tests/run_tests_matrix.py | 17 ++++++++++++++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh index c2ea6f2c6eb..b4b172ddef6 100755 --- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh +++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh @@ -44,9 +44,6 @@ mkdir -p /tmp/ccache # its cache location now that --download-cache is deprecated). mkdir -p /tmp/xdg-cache-home -# Create a local branch so the child Docker script won't complain -git branch -f jenkins-docker - # Inputs # DOCKERFILE_DIR - Directory in which Dockerfile file is located. # DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root) @@ -86,9 +83,12 @@ docker run \ $DOCKER_IMAGE_NAME \ bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_FAILED="true" -docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" $git_root || true -unzip -o $git_root/reports.zip -d $git_root || true -rm -f reports.zip +# use unique name for reports.zip to prevent clash between concurrent +# run_tests.py runs +TEMP_REPORTS_ZIP=`mktemp` +docker cp "$CONTAINER_NAME:/var/local/git/grpc/reports.zip" ${TEMP_REPORTS_ZIP} || true +unzip -o ${TEMP_REPORTS_ZIP} -d $git_root || true +rm -f ${TEMP_REPORTS_ZIP} # remove the container, possibly killing it first docker rm -f $CONTAINER_NAME || true diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh index 0e7604dbc55..b0c9ad05f76 100755 --- a/tools/run_tests/run_tests_in_workspace.sh +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -37,6 +37,8 @@ set -ex cd $(dirname $0)/../.. rm -rf "${WORKSPACE_NAME}" +# TODO(jtattermusch): clone --recursive fetches the submodules from github. +# Try avoiding that to save time and network capacity. git clone --recursive . "${WORKSPACE_NAME}" echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 2344e2f9fd8..bc2e37abd89 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -32,6 +32,7 @@ import argparse import jobset +import multiprocessing import os import report_utils import sys @@ -40,8 +41,12 @@ _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdir(_ROOT) # TODO(jtattermusch): this is not going to be enough for sanitizers. +# TODO(jtattermusch): this is not going to be enough for rebuilding clang docker. _RUNTESTS_TIMEOUT = 30*60 +# Number of jobs assigned to each run_tests.py instance +_INNER_JOBS = 2 + def _docker_jobspec(name, runtests_args=[]): """Run a single instance of run_tests.py in a docker container""" @@ -50,7 +55,7 @@ def _docker_jobspec(name, runtests_args=[]): cmdline=['python', 'tools/run_tests/run_tests.py', '--use_docker', '-t', - '-j', '3', + '-j', str(_INNER_JOBS), '-x', 'report_%s.xml' % name] + runtests_args, shortname='run_tests_%s' % name, timeout_seconds=_RUNTESTS_TIMEOUT) @@ -59,11 +64,13 @@ def _docker_jobspec(name, runtests_args=[]): def _workspace_jobspec(name, runtests_args=[], workspace_name=None): """Run a single instance of run_tests.py in a separate workspace""" + if not workspace_name: + workspace_name = 'workspace_%s' % name env = {'WORKSPACE_NAME': workspace_name} test_job = jobset.JobSpec( cmdline=['tools/run_tests/run_tests_in_workspace.sh', '-t', - '-j', '3', + '-j', str(_INNER_JOBS), '-x', '../report_%s.xml' % name] + runtests_args, environ=env, shortname='run_tests_%s' % name, @@ -196,6 +203,10 @@ for job in all_jobs: all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +argp.add_argument('-j', '--jobs', + default=multiprocessing.cpu_count()/_INNER_JOBS, + type=int, + help='Number of concurrent run_tests.py instances.') argp.add_argument('-f', '--filter', choices=sorted(all_labels), nargs='+', @@ -227,7 +238,7 @@ jobset.message('START', 'Running test matrix.', do_newline=True) num_failures, resultset = jobset.run(jobs, newline_on_success=True, travis=True, - maxjobs=2) + maxjobs=args.jobs) report_utils.render_junit_xml_report(resultset, 'report.xml') if num_failures == 0: From 5b34c4fc099d8b8df0696c1255009c144bf03cd4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 20 Sep 2016 16:06:13 +0200 Subject: [PATCH 082/123] address some TODOs --- tools/run_tests/run_tests_matrix.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index bc2e37abd89..06ab02e32fb 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -40,9 +40,9 @@ import sys _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdir(_ROOT) -# TODO(jtattermusch): this is not going to be enough for sanitizers. -# TODO(jtattermusch): this is not going to be enough for rebuilding clang docker. -_RUNTESTS_TIMEOUT = 30*60 +# Set the timeout high to allow enough time for sanitizers and pre-building +# clang docker. +_RUNTESTS_TIMEOUT = 2*60*60 # Number of jobs assigned to each run_tests.py instance _INNER_JOBS = 2 @@ -50,7 +50,6 @@ _INNER_JOBS = 2 def _docker_jobspec(name, runtests_args=[]): """Run a single instance of run_tests.py in a docker container""" - # TODO: fix copying report files from inside docker.... test_job = jobset.JobSpec( cmdline=['python', 'tools/run_tests/run_tests.py', '--use_docker', @@ -203,6 +202,8 @@ for job in all_jobs: all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') +# TODO(jtattermusch): allow running tests with --build_only flag +# TODO(jtattermusch): allow running tests with --force_default_poller flag. argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count()/_INNER_JOBS, type=int, From 7a6c2235d522b67e9dfe77311e2239463abc8cd5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 13:40:48 +0200 Subject: [PATCH 083/123] support passing extra args to run_tests.py --- tools/run_tests/run_tests_matrix.py | 90 +++++++++++++++++++---------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 06ab02e32fb..ae7fdd84f9b 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -79,7 +79,7 @@ def _workspace_jobspec(name, runtests_args=[], workspace_name=None): def _generate_jobs(languages, configs, platforms, arch=None, compiler=None, - labels=[]): + labels=[], extra_args=[]): result = [] for language in languages: for platform in platforms: @@ -92,6 +92,7 @@ def _generate_jobs(languages, configs, platforms, runtests_args += ['--arch', arch, '--compiler', compiler] + runtests_args += extra_args if platform == 'linux': job = _docker_jobspec(name=name, runtests_args=runtests_args) else: @@ -102,45 +103,51 @@ def _generate_jobs(languages, configs, platforms, return result -def _create_test_jobs(): +def _create_test_jobs(extra_args=[]): test_jobs = [] # supported on linux only test_jobs += _generate_jobs(languages=['sanity', 'php7'], configs=['dbg', 'opt'], platforms=['linux'], - labels=['basictests']) + labels=['basictests'], + extra_args=extra_args) # supported on all platforms. test_jobs += _generate_jobs(languages=['c', 'csharp', 'node', 'python'], - configs=['dbg', 'opt'], - platforms=['linux', 'macos', 'windows'], - labels=['basictests']) + configs=['dbg', 'opt'], + platforms=['linux', 'macos', 'windows'], + labels=['basictests'], + extra_args=extra_args) # supported on linux and mac. test_jobs += _generate_jobs(languages=['c++', 'ruby', 'php'], - configs=['dbg', 'opt'], - platforms=['linux', 'macos'], - labels=['basictests']) + configs=['dbg', 'opt'], + platforms=['linux', 'macos'], + labels=['basictests'], + extra_args=extra_args) # supported on mac only. test_jobs += _generate_jobs(languages=['objc'], configs=['dbg', 'opt'], platforms=['macos'], - labels=['basictests']) + labels=['basictests'], + extra_args=extra_args) # sanitizers test_jobs += _generate_jobs(languages=['c'], configs=['msan', 'asan', 'tsan'], platforms=['linux'], - labels=['sanitizers']) + labels=['sanitizers'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['c++'], configs=['asan', 'tsan'], platforms=['linux'], - labels=['sanitizers']) + labels=['sanitizers'], + extra_args=extra_args) return test_jobs -def _create_portability_test_jobs(): +def _create_portability_test_jobs(extra_args=[]): test_jobs = [] # portability C x86 test_jobs += _generate_jobs(languages=['c'], @@ -148,7 +155,8 @@ def _create_portability_test_jobs(): platforms=['linux'], arch='x86', compiler='default', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) # portability C and C++ on x64 for compiler in ['gcc4.4', 'gcc4.6', 'gcc5.3', @@ -158,7 +166,8 @@ def _create_portability_test_jobs(): platforms=['linux'], arch='x64', compiler=compiler, - labels=['portability']) + labels=['portability'], + extra_args=extra_args) # portability C on Windows for arch in ['x86', 'x64']: @@ -168,53 +177,72 @@ def _create_portability_test_jobs(): platforms=['windows'], arch=arch, compiler=compiler, - labels=['portability']) + labels=['portability'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['python'], configs=['dbg'], platforms=['linux'], arch='default', compiler='python3.4', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) test_jobs += _generate_jobs(languages=['csharp'], configs=['dbg'], platforms=['linux'], arch='default', compiler='coreclr', - labels=['portability']) + labels=['portability'], + extra_args=extra_args) for compiler in ['node5', 'node6', 'node0.12']: test_jobs += _generate_jobs(languages=['node'], - configs=['dbg'], - platforms=['linux'], - arch='default', - compiler=compiler, - labels=['portability']) + configs=['dbg'], + platforms=['linux'], + arch='default', + compiler=compiler, + labels=['portability'], + extra_args=extra_args) return test_jobs -all_jobs = _create_test_jobs() + _create_portability_test_jobs() +def _allowed_labels(): + """Returns a list of existing job labels.""" + all_labels = set() + for job in _create_test_jobs() + _create_portability_test_jobs(): + for label in job.labels: + all_labels.add(label) + return sorted(all_labels) -all_labels = set() -for job in all_jobs: - for label in job.labels: - all_labels.add(label) argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.') -# TODO(jtattermusch): allow running tests with --build_only flag -# TODO(jtattermusch): allow running tests with --force_default_poller flag. argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count()/_INNER_JOBS, type=int, help='Number of concurrent run_tests.py instances.') argp.add_argument('-f', '--filter', - choices=sorted(all_labels), + choices=_allowed_labels(), nargs='+', default=[], help='Filter targets to run by label with AND semantics.') +argp.add_argument('--build_only', + default=False, + action='store_const', + const=True, + help='Pass --build_only flag to run_tests.py instances.') +argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, + help='Pass --force_default_poller to run_tests.py instances.') args = argp.parse_args() +extra_args = [] +if args.build_only: + extra_args.append('--build_only') +if args.force_default_poller: + extra_args.append('--force_default_poller') + +all_jobs = _create_test_jobs(extra_args=extra_args) + _create_portability_test_jobs(extra_args=extra_args) + jobs = [] for job in all_jobs: if not args.filter or all(filter in job.labels for filter in args.filter): From f098c753baf059b5c01699b8f56c194180cbf3e1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:28:07 +0200 Subject: [PATCH 084/123] node6 portability test not yet implemented --- tools/run_tests/run_tests_matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index ae7fdd84f9b..d87632d8891 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -196,7 +196,7 @@ def _create_portability_test_jobs(extra_args=[]): labels=['portability'], extra_args=extra_args) - for compiler in ['node5', 'node6', 'node0.12']: + for compiler in ['node5', 'node0.12']: test_jobs += _generate_jobs(languages=['node'], configs=['dbg'], platforms=['linux'], From e922d7702eb8ead6acfa23fc44823b699bc6a72f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:31:10 +0200 Subject: [PATCH 085/123] support --dry_run flag --- tools/run_tests/run_tests_matrix.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index d87632d8891..a31b0dd9177 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -233,6 +233,11 @@ argp.add_argument('--build_only', help='Pass --build_only flag to run_tests.py instances.') argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, help='Pass --force_default_poller to run_tests.py instances.') +argp.add_argument('--dry_run', + default=False, + action='store_const', + const=True, + help='Only print what would be run.') args = argp.parse_args() extra_args = [] @@ -263,6 +268,10 @@ for job in jobs: print ' %s' % job.shortname print +if args.dry_run: + print '--dry_run was used, exiting' + sys.exit(1) + jobset.message('START', 'Running test matrix.', do_newline=True) num_failures, resultset = jobset.run(jobs, newline_on_success=True, From b6b4f8759b641aee0d737d16d8375560d9024e4d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Sep 2016 14:44:27 +0200 Subject: [PATCH 086/123] better --dry_run printouts --- tools/run_tests/run_tests_matrix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index a31b0dd9177..d5f90478257 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -265,7 +265,10 @@ print('copied to the docker environment or into subworkspaces.') print print 'Will run these tests:' for job in jobs: - print ' %s' % job.shortname + if args.dry_run: + print ' %s: "%s"' % (job.shortname, ' '.join(job.cmdline)) + else: + print ' %s' % job.shortname print if args.dry_run: From 1b0dd825cc6e56fa79c5de46452069aee87193e5 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 11:52:32 +0200 Subject: [PATCH 087/123] fixes for run_tests_in_workspace.sh --- tools/run_tests/run_tests_in_workspace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/run_tests_in_workspace.sh index b0c9ad05f76..98ef3566db1 100755 --- a/tools/run_tests/run_tests_in_workspace.sh +++ b/tools/run_tests/run_tests_in_workspace.sh @@ -42,5 +42,5 @@ rm -rf "${WORKSPACE_NAME}" git clone --recursive . "${WORKSPACE_NAME}" echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" -"${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ +python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" $@ From ad666a94142db43593456f4cd88645ff80e66786 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 15:08:36 +0200 Subject: [PATCH 088/123] remove node portability targets --- tools/run_tests/run_tests_matrix.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index d5f90478257..a94f9cfef5e 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -195,15 +195,6 @@ def _create_portability_test_jobs(extra_args=[]): compiler='coreclr', labels=['portability'], extra_args=extra_args) - - for compiler in ['node5', 'node0.12']: - test_jobs += _generate_jobs(languages=['node'], - configs=['dbg'], - platforms=['linux'], - arch='default', - compiler=compiler, - labels=['portability'], - extra_args=extra_args) return test_jobs From ffdd3a3cab09235c11efc34bea2ee6746dd54f12 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Oct 2016 17:52:15 +0200 Subject: [PATCH 089/123] add proxy script for run_tests_matrix.py --- tools/jenkins/run_jenkins_matrix.sh | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 tools/jenkins/run_jenkins_matrix.sh diff --git a/tools/jenkins/run_jenkins_matrix.sh b/tools/jenkins/run_jenkins_matrix.sh new file mode 100755 index 00000000000..b3783e69584 --- /dev/null +++ b/tools/jenkins/run_jenkins_matrix.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Copyright 2015, 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. +# +# This script is invoked by Jenkins and triggers a test run, bypassing +# all args to the test script. +# +# Setting up rvm environment BEFORE we set -ex. +[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh +# To prevent cygwin bash complaining about empty lines ending with \r +# we set the igncr option. The option doesn't exist on Linux, so we fallback +# to just 'set -ex' there. +# NOTE: No empty lines should appear in this file before igncr is set! +set -ex -o igncr || set -ex + +python tools/run_tests/run_tests_matrix.py $@ From 5f33e0b1d4c6c6ec394967afba703fdb76c73738 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 3 Oct 2016 19:47:37 +0200 Subject: [PATCH 090/123] fix building go interop image --- .../interoptest/grpc_interop_go/build_interop.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/dockerfile/interoptest/grpc_interop_go/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_go/build_interop.sh index 1fd088322cd..858ee0a68cd 100755 --- a/tools/dockerfile/interoptest/grpc_interop_go/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_go/build_interop.sh @@ -36,19 +36,12 @@ set -e # to test instead of using "go get" to download from Github directly. git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc +# Get all gRPC Go dependencies +(cd src/google.golang.org/grpc && go get -t .) + # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true -# Get dependencies from GitHub -# NOTE: once grpc-go dependencies change, this needs to be updated manually -# but we don't expect this to happen any time soon. -go get github.com/golang/protobuf/proto -go get golang.org/x/net/context -go get golang.org/x/net/trace -go get golang.org/x/oauth2 -go get golang.org/x/oauth2/google -go get google.golang.org/cloud - # Build the interop client and server (cd src/google.golang.org/grpc/interop/client && go install) (cd src/google.golang.org/grpc/interop/server && go install) From 8e5a2eab00ba0a14d4352fcf49ff12e6e870ba72 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 5 Oct 2016 15:26:03 +0200 Subject: [PATCH 091/123] add script to reboot a jenkins slave --- tools/jenkins/reboot_worker.sh | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 tools/jenkins/reboot_worker.sh diff --git a/tools/jenkins/reboot_worker.sh b/tools/jenkins/reboot_worker.sh new file mode 100755 index 00000000000..285e699b9b9 --- /dev/null +++ b/tools/jenkins/reboot_worker.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Copyright 2016, 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. +# +# Reboots Jenkins worker +# +# NOTE: No empty lines should appear in this file before igncr is set! +set -ex -o igncr || set -ex + +# Give 5 seconds to finish the current job, then kill the jenkins slave process +# to avoid running any other jobs on the worker and restart the worker. +nohup sh -c 'sleep 5; killall java; sudo reboot' & From a3570f22d06ce2aa3bc6bf20784b79243db935e8 Mon Sep 17 00:00:00 2001 From: Lizan Zhou Date: Mon, 5 Sep 2016 13:29:17 +0900 Subject: [PATCH 092/123] Fix grpc_byte_buffer_copy to copy compression algorithm --- src/core/lib/surface/byte_buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/lib/surface/byte_buffer.c b/src/core/lib/surface/byte_buffer.c index a093a37af32..054a6e6c586 100644 --- a/src/core/lib/surface/byte_buffer.c +++ b/src/core/lib/surface/byte_buffer.c @@ -72,8 +72,9 @@ grpc_byte_buffer *grpc_raw_byte_buffer_from_reader( grpc_byte_buffer *grpc_byte_buffer_copy(grpc_byte_buffer *bb) { switch (bb->type) { case GRPC_BB_RAW: - return grpc_raw_byte_buffer_create(bb->data.raw.slice_buffer.slices, - bb->data.raw.slice_buffer.count); + return grpc_raw_compressed_byte_buffer_create( + bb->data.raw.slice_buffer.slices, bb->data.raw.slice_buffer.count, + bb->data.raw.compression); } GPR_UNREACHABLE_CODE(return NULL); } From c7cf9a69a4299fffd071c0436df43a0a187a60fa Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 5 Oct 2016 17:36:14 -0700 Subject: [PATCH 093/123] Fix maybe-uninitialized variable --- src/core/ext/transport/cronet/transport/cronet_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 19e43673b99..984a8bb5551 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -781,7 +781,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, &cronet_callbacks); CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs); char *url; - const char *method; + const char *method = NULL; s->header_array.headers = NULL; convert_metadata_to_cronet_headers( stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url, From 4552f6aad888878fb15b292c134b5d90233d5491 Mon Sep 17 00:00:00 2001 From: Yuchen Zeng Date: Wed, 5 Oct 2016 17:54:00 -0700 Subject: [PATCH 094/123] Init method as POST --- src/core/ext/transport/cronet/transport/cronet_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 984a8bb5551..4431d58351e 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -781,7 +781,7 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, &cronet_callbacks); CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs); char *url; - const char *method = NULL; + const char *method = "POST"; s->header_array.headers = NULL; convert_metadata_to_cronet_headers( stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url, From bc4ea6d727692c1720df7a3480f8d86c73d68df0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 6 Oct 2016 14:01:02 +0200 Subject: [PATCH 095/123] fix compilation error --- src/core/ext/transport/cronet/transport/cronet_transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 19e43673b99..f7f57ac825c 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -780,8 +780,8 @@ static enum e_op_result execute_stream_op(grpc_exec_ctx *exec_ctx, s->cbs = cronet_bidirectional_stream_create(s->curr_ct.engine, s->curr_gs, &cronet_callbacks); CRONET_LOG(GPR_DEBUG, "%p = cronet_bidirectional_stream_create()", s->cbs); - char *url; - const char *method; + char *url = NULL; + const char *method = NULL; s->header_array.headers = NULL; convert_metadata_to_cronet_headers( stream_op->send_initial_metadata->list.head, s->curr_ct.host, &url, From 8bc8a83656eaf1bb3b1362edbb590013bd62a4a7 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 6 Oct 2016 08:11:29 -0700 Subject: [PATCH 096/123] Update tests. --- test/core/bad_ssl/bad_ssl_test.c | 2 +- test/core/end2end/connection_refused_test.c | 14 +++++++------- test/core/end2end/dualstack_socket_test.c | 2 +- test/core/end2end/tests/simple_delayed_request.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/core/bad_ssl/bad_ssl_test.c b/test/core/bad_ssl/bad_ssl_test.c index c9cdb169b61..f8a9fe6caca 100644 --- a/test/core/bad_ssl/bad_ssl_test.c +++ b/test/core/bad_ssl/bad_ssl_test.c @@ -88,7 +88,7 @@ static void run_test(const char *target, size_t nops) { op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; - op->flags = GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY; + op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; diff --git a/test/core/end2end/connection_refused_test.c b/test/core/end2end/connection_refused_test.c index 4149159a378..62278d63c5a 100644 --- a/test/core/end2end/connection_refused_test.c +++ b/test/core/end2end/connection_refused_test.c @@ -44,7 +44,7 @@ static void *tag(intptr_t i) { return (void *)i; } -static void run_test(bool fail_fast) { +static void run_test(bool wait_for_ready) { grpc_channel *chan; grpc_call *call; gpr_timespec deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(2); @@ -57,7 +57,7 @@ static void run_test(bool fail_fast) { char *details = NULL; size_t details_capacity = 0; - gpr_log(GPR_INFO, "TEST: fail_fast=%d", fail_fast); + gpr_log(GPR_INFO, "TEST: wait_for_ready=%d", wait_for_ready); grpc_init(); @@ -81,7 +81,7 @@ static void run_test(bool fail_fast) { op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; - op->flags = fail_fast ? 0 : GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY; + op->flags = wait_for_ready ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0; op->reserved = NULL; op++; op->op = GRPC_OP_RECV_STATUS_ON_CLIENT; @@ -98,10 +98,10 @@ static void run_test(bool fail_fast) { CQ_EXPECT_COMPLETION(cqv, tag(1), 1); cq_verify(cqv); - if (fail_fast) { - GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); - } else { + if (wait_for_ready) { GPR_ASSERT(status == GRPC_STATUS_DEADLINE_EXCEEDED); + } else { + GPR_ASSERT(status == GRPC_STATUS_UNAVAILABLE); } grpc_completion_queue_shutdown(cq); @@ -122,7 +122,7 @@ static void run_test(bool fail_fast) { int main(int argc, char **argv) { grpc_test_init(argc, argv); - run_test(true); run_test(false); + run_test(true); return 0; } diff --git a/test/core/end2end/dualstack_socket_test.c b/test/core/end2end/dualstack_socket_test.c index 8abb81c803a..cb07ca535b3 100644 --- a/test/core/end2end/dualstack_socket_test.c +++ b/test/core/end2end/dualstack_socket_test.c @@ -171,7 +171,7 @@ void test_connect(const char *server_host, const char *client_host, int port, op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; - op->flags = expect_ok ? GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY : 0; + op->flags = expect_ok ? GRPC_INITIAL_METADATA_WAIT_FOR_READY : 0; op->reserved = NULL; op++; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; diff --git a/test/core/end2end/tests/simple_delayed_request.c b/test/core/end2end/tests/simple_delayed_request.c index 74f1232d786..50d1975c8d0 100644 --- a/test/core/end2end/tests/simple_delayed_request.c +++ b/test/core/end2end/tests/simple_delayed_request.c @@ -119,7 +119,7 @@ static void simple_delayed_request_body(grpc_end2end_test_config config, op = ops; op->op = GRPC_OP_SEND_INITIAL_METADATA; op->data.send_initial_metadata.count = 0; - op->flags = GRPC_INITIAL_METADATA_IGNORE_CONNECTIVITY; + op->flags = GRPC_INITIAL_METADATA_WAIT_FOR_READY; op->reserved = NULL; op++; op->op = GRPC_OP_SEND_CLOSE_FROM_CLIENT; From 624f4ba76d99b14d9e90fee03cee8d0866e1bca6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 6 Oct 2016 11:56:54 -0700 Subject: [PATCH 097/123] Add missing delete --- test/cpp/qps/client_async.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 5d9cb4bd0cf..081114859ce 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -243,6 +243,7 @@ class AsyncClient : public ClientImpl { // this thread isn't supposed to shut down std::lock_guard l(shutdown_state_[thread_idx]->mutex); if (shutdown_state_[thread_idx]->shutdown) { + delete ctx; return true; } else if (!ctx->RunNextState(ok, entry)) { // The RPC and callback are done, so clone the ctx From 6f6f94fc92517b1487034e8d72be0b6779eb51ff Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 6 Oct 2016 12:16:31 -0700 Subject: [PATCH 098/123] Fix header. --- src/cpp/common/channel_filter.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h index 6f5af3dec31..ae32e02f699 100644 --- a/src/cpp/common/channel_filter.h +++ b/src/cpp/common/channel_filter.h @@ -42,6 +42,7 @@ #include #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/security/context/security_context.h" #include "src/core/lib/surface/channel_init.h" #include "src/core/lib/transport/metadata_batch.h" @@ -54,11 +55,6 @@ /// "name-of-filter", GRPC_SERVER_CHANNEL, INT_MAX, nullptr); /// \endcode -/// Forward declaration to avoid including the file -/// "src/core/lib/security/context/security_context.h" -struct grpc_client_security_context; -struct grpc_server_security_context; - namespace grpc { /// A C++ wrapper for the \c grpc_metadata_batch struct. From 619c034fefab80def5ede91f6c28ef4013410035 Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Thu, 6 Oct 2016 12:22:02 -0700 Subject: [PATCH 099/123] php: require grpc extension to be installed before composer package --- composer.json | 1 + examples/php/composer.json | 1 + src/php/composer.json | 1 + templates/composer.json.template | 1 + templates/src/php/composer.json.template | 1 + tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh | 2 +- tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh | 2 +- .../stress_test/grpc_interop_stress_php/build_interop_stress.sh | 2 +- 8 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c5c7ae81d88..711ee82b79a 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "license": "BSD-3-Clause", "require": { "php": ">=5.5.0", + "ext-grpc": "*", "google/protobuf": "v3.1.0-alpha-1" }, "require-dev": { diff --git a/examples/php/composer.json b/examples/php/composer.json index e6409f87b43..3d1a95d0045 100644 --- a/examples/php/composer.json +++ b/examples/php/composer.json @@ -2,6 +2,7 @@ "name": "grpc/grpc-demo", "description": "gRPC example for PHP", "require": { + "ext-grpc": "*", "grpc/grpc": "v1.0.0" } } diff --git a/src/php/composer.json b/src/php/composer.json index 60420940321..2d5d555bc29 100644 --- a/src/php/composer.json +++ b/src/php/composer.json @@ -8,6 +8,7 @@ "version": "1.1.0", "require": { "php": ">=5.5.0", + "ext-grpc": "*", "google/protobuf": "v3.1.0-alpha-1" }, "require-dev": { diff --git a/templates/composer.json.template b/templates/composer.json.template index accfb382a99..3b4d62f24db 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -9,6 +9,7 @@ "license": "BSD-3-Clause", "require": { "php": ">=5.5.0", + "ext-grpc": "*", "google/protobuf": "v3.1.0-alpha-1" }, "require-dev": { diff --git a/templates/src/php/composer.json.template b/templates/src/php/composer.json.template index 7feeae976d8..12a4ce8f83f 100644 --- a/templates/src/php/composer.json.template +++ b/templates/src/php/composer.json.template @@ -10,6 +10,7 @@ "version": "${settings.php_version.php_composer()}", "require": { "php": ">=5.5.0", + "ext-grpc": "*", "google/protobuf": "v3.1.0-alpha-1" }, "require-dev": { diff --git a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh index cf5e888effb..624d5877862 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php/build_interop.sh @@ -46,6 +46,6 @@ make install (cd third_party/protobuf && make install) -(cd src/php && composer install) +(cd src/php && php -d extension=ext/grpc/modules/grpc.so /usr/local/bin/composer install) (cd src/php && ./bin/generate_proto_php.sh) diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh index e486e5276a8..87cb0fe4b21 100755 --- a/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_php7/build_interop.sh @@ -46,6 +46,6 @@ make install (cd third_party/protobuf && make install) -(cd src/php && composer install) +(cd src/php && php -d extension=ext/grpc/modules/grpc.so /usr/local/bin/composer install) (cd src/php && ./bin/generate_proto_php.sh) diff --git a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh index 34fd09f78b0..a671d1501f8 100755 --- a/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh +++ b/tools/dockerfile/stress_test/grpc_interop_stress_php/build_interop_stress.sh @@ -48,6 +48,6 @@ make install (cd third_party/protobuf && make install) -(cd src/php && composer install) +(cd src/php && php -d extension=ext/grpc/modules/grpc.so /usr/local/bin/composer install) (cd src/php && ./bin/generate_proto_php.sh) From 757e84ef1cfd50661cb8242debd7a7990448dde1 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Thu, 6 Oct 2016 13:07:53 -0700 Subject: [PATCH 100/123] Add 'extern "C"' to error.h. --- src/core/lib/iomgr/error.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index 7e2fd7a3bd6..00ace8a7a91 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -40,6 +40,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + /// Opaque representation of an error. /// Errors are refcounted objects that represent the result of an operation. /// Ownership laws: @@ -204,4 +208,8 @@ bool grpc_log_if_error(const char *what, grpc_error *error, const char *file, #define GRPC_LOG_IF_ERROR(what, error) \ grpc_log_if_error((what), (error), __FILE__, __LINE__) +#ifdef __cplusplus +} +#endif + #endif /* GRPC_CORE_LIB_IOMGR_ERROR_H */ From 82b64d1565318afb40d72d46e890766d24368dc8 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Thu, 6 Oct 2016 17:33:12 -0700 Subject: [PATCH 101/123] change back slashes to forward slashes in grpc.tool nuspec --- src/csharp/Grpc.Tools.nuspec | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec index 0c937ab9cbf..ba4e1d674cd 100644 --- a/src/csharp/Grpc.Tools.nuspec +++ b/src/csharp/Grpc.Tools.nuspec @@ -17,17 +17,17 @@ - - - - - - - - - - - - + + + + + + + + + + + + From e480a6a1f91e1167c33d08a208e3fabfee940584 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 7 Oct 2016 12:59:08 +0200 Subject: [PATCH 102/123] dont eat run_tests.py errors on test failure --- tools/run_tests/dockerize/build_docker_and_run_tests.sh | 8 +++----- tools/run_tests/run_tests.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh index b4b172ddef6..c3219c533d5 100755 --- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh +++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh @@ -61,6 +61,7 @@ CONTAINER_NAME="run_tests_$(uuidgen)" docker_instance_git_root=/var/local/jenkins/grpc # Run tests inside docker +DOCKER_EXIT_CODE=0 docker run \ -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \ -e "config=$config" \ @@ -81,7 +82,7 @@ docker run \ -w /var/local/git/grpc \ --name=$CONTAINER_NAME \ $DOCKER_IMAGE_NAME \ - bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_FAILED="true" + bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_EXIT_CODE=$? # use unique name for reports.zip to prevent clash between concurrent # run_tests.py runs @@ -93,7 +94,4 @@ rm -f ${TEMP_REPORTS_ZIP} # remove the container, possibly killing it first docker rm -f $CONTAINER_NAME || true -if [ "$DOCKER_FAILED" != "" ] && [ "$XML_REPORT" == "" ] -then - exit 1 -fi +exit $DOCKER_EXIT_CODE diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 168331602ca..a6f3d405dc2 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1423,7 +1423,7 @@ else: exit_code = 0 if BuildAndRunError.BUILD in errors: exit_code |= 1 - if BuildAndRunError.TEST in errors and not args.travis: + if BuildAndRunError.TEST in errors: exit_code |= 2 if BuildAndRunError.POST_TEST in errors: exit_code |= 4 From ab7abdb968d0a455e3b0ed2f33722243283e9bb9 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 7 Oct 2016 12:59:08 +0200 Subject: [PATCH 103/123] dont eat run_tests.py errors on test failure --- tools/run_tests/dockerize/build_docker_and_run_tests.sh | 8 +++----- tools/run_tests/run_tests.py | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh index b4b172ddef6..c3219c533d5 100755 --- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh +++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh @@ -61,6 +61,7 @@ CONTAINER_NAME="run_tests_$(uuidgen)" docker_instance_git_root=/var/local/jenkins/grpc # Run tests inside docker +DOCKER_EXIT_CODE=0 docker run \ -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND" \ -e "config=$config" \ @@ -81,7 +82,7 @@ docker run \ -w /var/local/git/grpc \ --name=$CONTAINER_NAME \ $DOCKER_IMAGE_NAME \ - bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_FAILED="true" + bash -l "/var/local/jenkins/grpc/$DOCKER_RUN_SCRIPT" || DOCKER_EXIT_CODE=$? # use unique name for reports.zip to prevent clash between concurrent # run_tests.py runs @@ -93,7 +94,4 @@ rm -f ${TEMP_REPORTS_ZIP} # remove the container, possibly killing it first docker rm -f $CONTAINER_NAME || true -if [ "$DOCKER_FAILED" != "" ] && [ "$XML_REPORT" == "" ] -then - exit 1 -fi +exit $DOCKER_EXIT_CODE diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 3ccba877c99..c7d10e057f5 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1369,7 +1369,7 @@ else: exit_code = 0 if BuildAndRunError.BUILD in errors: exit_code |= 1 - if BuildAndRunError.TEST in errors and not args.travis: + if BuildAndRunError.TEST in errors: exit_code |= 2 if BuildAndRunError.POST_TEST in errors: exit_code |= 4 From 2b39808e1c998f67b32d3c2bda0b7bb64a92db76 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 7 Oct 2016 14:40:30 +0200 Subject: [PATCH 104/123] fix building ruby artifact --- src/core/ext/lb_policy/grpclb/grpclb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 63af774ea6d..a64414877f0 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -329,8 +329,8 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx, if (server->port >> 16 != 0) { if (log) { gpr_log(GPR_ERROR, - "Invalid port '%d' at index %zu of serverlist. Ignoring.", - server->port, idx); + "Invalid port '%d' at index %lu of serverlist. Ignoring.", + server->port, (unsigned long)idx); } return false; } @@ -338,9 +338,9 @@ static bool is_server_valid(const grpc_grpclb_server *server, size_t idx, if (ip->size != 4 && ip->size != 16) { if (log) { gpr_log(GPR_ERROR, - "Expected IP to be 4 or 16 bytes, got %d at index %zu of " + "Expected IP to be 4 or 16 bytes, got %d at index %lu of " "serverlist. Ignoring", - ip->size, idx); + ip->size, (unsigned long)idx); } return false; } @@ -1070,8 +1070,8 @@ static void res_recv_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { if (serverlist != NULL) { gpr_slice_unref(response_slice); if (grpc_lb_glb_trace) { - gpr_log(GPR_INFO, "Serverlist with %zu servers received", - serverlist->num_servers); + gpr_log(GPR_INFO, "Serverlist with %lu servers received", + (unsigned long)serverlist->num_servers); } /* update serverlist */ @@ -1155,10 +1155,10 @@ static void srv_status_rcvd_cb(grpc_exec_ctx *exec_ctx, void *arg, if (grpc_lb_glb_trace) { gpr_log(GPR_INFO, "status from lb server received. Status = %d, Details = '%s', " - "Capaticy " - "= %zu", + "Capacity " + "= %lu", lb_client->status, lb_client->status_details, - lb_client->status_details_capacity); + (unsigned long)lb_client->status_details_capacity); } /* TODO(dgq): deal with stream termination properly (fire up another one? * fail the original call?) */ From 1e5f6af0c7deda7a101d9842fba78682f5c7aa0c Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 7 Oct 2016 08:32:58 -0700 Subject: [PATCH 105/123] Fix grpclb LB policy pick method to return 0 upon error. --- src/core/ext/client_config/lb_policy.h | 21 ++++++++++++--------- src/core/ext/lb_policy/grpclb/grpclb.c | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/core/ext/client_config/lb_policy.h b/src/core/ext/client_config/lb_policy.h index 6cc3e1ebd38..110d08fcac1 100644 --- a/src/core/ext/client_config/lb_policy.h +++ b/src/core/ext/client_config/lb_policy.h @@ -142,15 +142,18 @@ void grpc_lb_policy_weak_unref(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy); void grpc_lb_policy_init(grpc_lb_policy *policy, const grpc_lb_policy_vtable *vtable); -/** Find an appropriate target for this call, based on \a pick_args. - Picking can be synchronous or asynchronous. In the synchronous case, when a - pick is readily available, it'll be returned in \a target and a non-zero - value will be returned. - In the asynchronous case, zero is returned and \a on_complete will be called - once \a target and \a user_data have been set. Any IO should be done under - \a pick_args->pollent. The opaque \a user_data output argument corresponds - to information that may need be propagated from the LB policy. It may be - NULL. Errors are signaled by receiving a NULL \a *target. */ +/** Finds an appropriate subchannel for a call, based on \a pick_args. + + \a target will be set to the selected subchannel, or NULL on failure. + Upon success, \a user_data will be set to whatever opaque information + may need to be propagated from the LB policy, or NULL if not needed. + + If the pick succeeds and a result is known immediately, a non-zero + value will be returned. Otherwise, \a on_complete will be invoked + once the pick is complete with its error argument set to indicate + success or failure. + + Any I/O should be done under \a pick_args->pollent. */ int grpc_lb_policy_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, const grpc_lb_policy_pick_args *pick_args, grpc_connected_subchannel **target, void **user_data, diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c index 63af774ea6d..ae1f2a3b4c6 100644 --- a/src/core/ext/lb_policy/grpclb/grpclb.c +++ b/src/core/ext/lb_policy/grpclb/grpclb.c @@ -761,7 +761,7 @@ static int glb_pick(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, GRPC_ERROR_CREATE("No mdelem storage for the LB token. Load reporting " "won't work without it. Failing"), NULL); - return 1; + return 0; } glb_lb_policy *glb_policy = (glb_lb_policy *)pol; From cf16b76b9a85c801c51aab3b3fe7a1735a6839a4 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Fri, 7 Oct 2016 09:51:03 -0700 Subject: [PATCH 106/123] clang-format --- src/core/ext/transport/cronet/transport/cronet_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ext/transport/cronet/transport/cronet_transport.c b/src/core/ext/transport/cronet/transport/cronet_transport.c index 00a5be419ef..25ad40b935a 100644 --- a/src/core/ext/transport/cronet/transport/cronet_transport.c +++ b/src/core/ext/transport/cronet/transport/cronet_transport.c @@ -543,7 +543,7 @@ static void create_grpc_frame(gpr_slice_buffer *write_slice_buffer, static void convert_metadata_to_cronet_headers( grpc_linked_mdelem *head, const char *host, char **pp_url, cronet_bidirectional_stream_header **pp_headers, size_t *p_num_headers, - const char ** method) { + const char **method) { grpc_linked_mdelem *curr = head; /* Walk the linked list and get number of header fields */ size_t num_headers_available = 0; From 517503746c65944e9783b00ef004c403b6bd18a9 Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Mon, 10 Oct 2016 14:49:55 -0400 Subject: [PATCH 107/123] Check for the correct number of orphan callbacks in udp_server_test --- test/core/iomgr/udp_server_test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/core/iomgr/udp_server_test.c b/test/core/iomgr/udp_server_test.c index 2a304275043..71d2fb5bd44 100644 --- a/test/core/iomgr/udp_server_test.c +++ b/test/core/iomgr/udp_server_test.c @@ -131,8 +131,9 @@ static void test_no_op_with_port_and_start(void) { grpc_udp_server_destroy(&exec_ctx, s, NULL); grpc_exec_ctx_finish(&exec_ctx); - /* The server had a single FD, which should have been orphaned. */ - GPR_ASSERT(g_number_of_orphan_calls == 1); + /* The server had a single FD, which is orphaned once in * + * deactivated_all_ports, and once in grpc_udp_server_destroy. */ + GPR_ASSERT(g_number_of_orphan_calls == 2); } static void test_receive(int number_of_clients) { @@ -196,8 +197,9 @@ static void test_receive(int number_of_clients) { grpc_udp_server_destroy(&exec_ctx, s, NULL); grpc_exec_ctx_finish(&exec_ctx); - /* The server had a single FD, which should have been orphaned. */ - GPR_ASSERT(g_number_of_orphan_calls == 1); + /* The server had a single FD, which is orphaned once in * + * deactivated_all_ports, and once in grpc_udp_server_destroy. */ + GPR_ASSERT(g_number_of_orphan_calls == 2); } static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, From 41c06a2ed563e31add33212dd861f554fc426c2b Mon Sep 17 00:00:00 2001 From: Matt Kwong Date: Tue, 11 Oct 2016 13:49:23 -0700 Subject: [PATCH 108/123] move changes from dockerfile to template --- .../test/cxx_wheezy_x64/Dockerfile.template | 6 ++++++ tools/dockerfile/test/cxx_wheezy_x64/Dockerfile | 12 +++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile.template index b6a3b0d5d21..5c38e9a0e92 100644 --- a/templates/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile.template @@ -41,6 +41,12 @@ g++-4.4 ${'\\'} g++-4.4-multilib + # set up backport to allow installation of Git version > 1.7 + RUN echo "deb http://http.debian.net/debian wheezy-backports main" \ + >/etc/apt/sources.list.d/wheezy-backports.list + RUN apt-get update -qq + RUN apt-get -t wheezy-backports install -qq git + RUN wget ${openssl_fallback.base_uri + openssl_fallback.tarball} ENV POST_GIT_STEP tools/dockerfile/test/cxx_wheezy_x64/post-git-setup.sh diff --git a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile index 503a4357070..f22fcacc139 100644 --- a/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_wheezy_x64/Dockerfile @@ -63,13 +63,6 @@ RUN apt-get update && apt-get install -y \ # Build profiling RUN apt-get update && apt-get install -y time && apt-get clean -#================ -# Add backport to Debian sources.list and update git to version > 1.7 -RUN echo "deb http://http.debian.net/debian wheezy-backports main" \ - >/etc/apt/sources.list.d/wheezy-backports.list -RUN apt-get update -qq -RUN apt-get -t wheezy-backports install -y -qq git mercurial - #==================== # Python dependencies @@ -96,6 +89,11 @@ RUN apt-get update && apt-get install -y \ g++-4.4 \ g++-4.4-multilib +# set up backport to allow installation of Git version > 1.7 +RUN echo "deb http://http.debian.net/debian wheezy-backports main" >/etc/apt/sources.list.d/wheezy-backports.list +RUN apt-get update -qq +RUN apt-get -t wheezy-backports install -qq git + RUN wget https://openssl.org/source/old/1.0.2/openssl-1.0.2f.tar.gz ENV POST_GIT_STEP tools/dockerfile/test/cxx_wheezy_x64/post-git-setup.sh From cfcc0755a0c77180c3eaadea1c8d1103da2e8f36 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sun, 9 Oct 2016 17:02:34 +0200 Subject: [PATCH 109/123] more flexible test naming in reports --- tools/run_tests/report_utils.py | 7 ++++--- tools/run_tests/run_tests.py | 8 ++++++-- tools/run_tests/run_tests_matrix.py | 9 ++++++--- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/run_tests/report_utils.py b/tools/run_tests/report_utils.py index 5648a694cd0..efe5dc999d1 100644 --- a/tools/run_tests/report_utils.py +++ b/tools/run_tests/report_utils.py @@ -57,11 +57,12 @@ def _filter_msg(msg, output_format): return msg -def render_junit_xml_report(resultset, xml_report): +def render_junit_xml_report(resultset, xml_report, suite_package='grpc', + suite_name='tests'): """Generate JUnit-like XML report.""" root = ET.Element('testsuites') - testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', - name='tests') + testsuite = ET.SubElement(root, 'testsuite', id='1', package=suite_package, + name=suite_name) for shortname, results in resultset.items(): for result in results: xml_test = ET.SubElement(testsuite, 'testcase', name=shortname) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index a6f3d405dc2..dd070b1fe01 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1015,6 +1015,8 @@ argp.add_argument('--update_submodules', default=[], nargs='*', argp.add_argument('-a', '--antagonists', default=0, type=int) argp.add_argument('-x', '--xml_report', default=None, type=str, help='Generates a JUnit-compatible XML report') +argp.add_argument('--report_suite_name', default='tests', type=str, + help='Test suite name to use in generated JUnit XML report') argp.add_argument('--force_default_poller', default=False, action='store_const', const=True, help='Dont try to iterate over many polling strategies when they exist') args = argp.parse_args() @@ -1327,7 +1329,8 @@ def _build_and_run( if build_only: if xml_report: - report_utils.render_junit_xml_report(resultset, xml_report) + report_utils.render_junit_xml_report(resultset, xml_report, + suite_name=args.report_suite_name) return [] # start antagonists @@ -1379,7 +1382,8 @@ def _build_and_run( for antagonist in antagonists: antagonist.kill() if xml_report and resultset: - report_utils.render_junit_xml_report(resultset, xml_report) + report_utils.render_junit_xml_report(resultset, xml_report, + suite_name=args.report_suite_name) number_failures, _ = jobset.run( post_tests_steps, maxjobs=1, stop_on_failure=True, diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index a94f9cfef5e..60c21a1e218 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -55,7 +55,8 @@ def _docker_jobspec(name, runtests_args=[]): '--use_docker', '-t', '-j', str(_INNER_JOBS), - '-x', 'report_%s.xml' % name] + runtests_args, + '-x', 'report_%s.xml' % name, + '--report_suite_name', '%s' % name] + runtests_args, shortname='run_tests_%s' % name, timeout_seconds=_RUNTESTS_TIMEOUT) return test_job @@ -70,7 +71,8 @@ def _workspace_jobspec(name, runtests_args=[], workspace_name=None): cmdline=['tools/run_tests/run_tests_in_workspace.sh', '-t', '-j', str(_INNER_JOBS), - '-x', '../report_%s.xml' % name] + runtests_args, + '-x', '../report_%s.xml' % name, + '--report_suite_name', '%s' % name] + runtests_args, environ=env, shortname='run_tests_%s' % name, timeout_seconds=_RUNTESTS_TIMEOUT) @@ -271,7 +273,8 @@ num_failures, resultset = jobset.run(jobs, newline_on_success=True, travis=True, maxjobs=args.jobs) -report_utils.render_junit_xml_report(resultset, 'report.xml') +report_utils.render_junit_xml_report(resultset, 'report.xml', + suite_name='aggregate_tests') if num_failures == 0: jobset.message('SUCCESS', 'All run_tests.py instance finished successfully.', From 05cccba2f14648704725498439078766631f58f0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 5 Oct 2016 21:22:06 +0200 Subject: [PATCH 110/123] add comment for NewInstance override --- src/compiler/csharp_generator.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/csharp_generator.cc b/src/compiler/csharp_generator.cc index 591e5ae3d42..48157033db6 100644 --- a/src/compiler/csharp_generator.cc +++ b/src/compiler/csharp_generator.cc @@ -494,6 +494,9 @@ void GenerateClientStub(Printer *out, const ServiceDescriptor *service) { } // override NewInstance method + out->Print( + "/// Creates a new instance of client from given " + "ClientBaseConfiguration.\n"); out->Print( "protected override $name$ NewInstance(ClientBaseConfiguration " "configuration)\n", From 10098d1819c39a5083131b821adf86b738568362 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 6 Oct 2016 13:15:12 +0200 Subject: [PATCH 111/123] regenerate C# protos --- src/csharp/Grpc.Examples/Math.cs | 83 +++- src/csharp/Grpc.Examples/MathGrpc.cs | 1 + src/csharp/Grpc.HealthCheck/Health.cs | 35 +- src/csharp/Grpc.HealthCheck/HealthGrpc.cs | 1 + src/csharp/Grpc.IntegrationTesting/Control.cs | 401 ++++++++++++++++-- src/csharp/Grpc.IntegrationTesting/Empty.cs | 16 +- .../Grpc.IntegrationTesting/Messages.cs | 211 ++++++++- src/csharp/Grpc.IntegrationTesting/Metrics.cs | 53 ++- .../Grpc.IntegrationTesting/MetricsGrpc.cs | 1 + .../Grpc.IntegrationTesting/Payloads.cs | 70 ++- .../Grpc.IntegrationTesting/Services.cs | 1 - .../Grpc.IntegrationTesting/ServicesGrpc.cs | 2 + src/csharp/Grpc.IntegrationTesting/Stats.cs | 76 +++- src/csharp/Grpc.IntegrationTesting/Test.cs | 1 - .../Grpc.IntegrationTesting/TestGrpc.cs | 3 + 15 files changed, 887 insertions(+), 68 deletions(-) diff --git a/src/csharp/Grpc.Examples/Math.cs b/src/csharp/Grpc.Examples/Math.cs index a17228c8c5e..fae4fd3c264 100644 --- a/src/csharp/Grpc.Examples/Math.cs +++ b/src/csharp/Grpc.Examples/Math.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Math { /// Holder for reflection information generated from math.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MathReflection { #region Descriptor @@ -46,30 +45,35 @@ namespace Math { } #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class DivArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivArgs()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivArgs() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivArgs(DivArgs other) : this() { dividend_ = other.dividend_; divisor_ = other.divisor_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivArgs Clone() { return new DivArgs(this); } @@ -77,6 +81,7 @@ namespace Math { /// Field number for the "dividend" field. public const int DividendFieldNumber = 1; private long dividend_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Dividend { get { return dividend_; } set { @@ -87,6 +92,7 @@ namespace Math { /// Field number for the "divisor" field. public const int DivisorFieldNumber = 2; private long divisor_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Divisor { get { return divisor_; } set { @@ -94,10 +100,12 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DivArgs); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(DivArgs other) { if (ReferenceEquals(other, null)) { return false; @@ -110,6 +118,7 @@ namespace Math { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Dividend != 0L) hash ^= Dividend.GetHashCode(); @@ -117,10 +126,12 @@ namespace Math { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Dividend != 0L) { output.WriteRawTag(8); @@ -132,6 +143,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Dividend != 0L) { @@ -143,6 +155,7 @@ namespace Math { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(DivArgs other) { if (other == null) { return; @@ -155,6 +168,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -176,30 +190,35 @@ namespace Math { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class DivReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DivReply()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivReply() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivReply(DivReply other) : this() { quotient_ = other.quotient_; remainder_ = other.remainder_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public DivReply Clone() { return new DivReply(this); } @@ -207,6 +226,7 @@ namespace Math { /// Field number for the "quotient" field. public const int QuotientFieldNumber = 1; private long quotient_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Quotient { get { return quotient_; } set { @@ -217,6 +237,7 @@ namespace Math { /// Field number for the "remainder" field. public const int RemainderFieldNumber = 2; private long remainder_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Remainder { get { return remainder_; } set { @@ -224,10 +245,12 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as DivReply); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(DivReply other) { if (ReferenceEquals(other, null)) { return false; @@ -240,6 +263,7 @@ namespace Math { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Quotient != 0L) hash ^= Quotient.GetHashCode(); @@ -247,10 +271,12 @@ namespace Math { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Quotient != 0L) { output.WriteRawTag(8); @@ -262,6 +288,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Quotient != 0L) { @@ -273,6 +300,7 @@ namespace Math { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(DivReply other) { if (other == null) { return; @@ -285,6 +313,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -306,29 +335,34 @@ namespace Math { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FibArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibArgs()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibArgs() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibArgs(FibArgs other) : this() { limit_ = other.limit_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibArgs Clone() { return new FibArgs(this); } @@ -336,6 +370,7 @@ namespace Math { /// Field number for the "limit" field. public const int LimitFieldNumber = 1; private long limit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Limit { get { return limit_; } set { @@ -343,10 +378,12 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as FibArgs); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(FibArgs other) { if (ReferenceEquals(other, null)) { return false; @@ -358,16 +395,19 @@ namespace Math { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Limit != 0L) hash ^= Limit.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Limit != 0L) { output.WriteRawTag(8); @@ -375,6 +415,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Limit != 0L) { @@ -383,6 +424,7 @@ namespace Math { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(FibArgs other) { if (other == null) { return; @@ -392,6 +434,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -409,29 +452,34 @@ namespace Math { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Num : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Num()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.MessageTypes[3]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Num() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Num(Num other) : this() { num_ = other.num_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Num Clone() { return new Num(this); } @@ -439,6 +487,7 @@ namespace Math { /// Field number for the "num" field. public const int Num_FieldNumber = 1; private long num_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Num_ { get { return num_; } set { @@ -446,10 +495,12 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Num); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Num other) { if (ReferenceEquals(other, null)) { return false; @@ -461,16 +512,19 @@ namespace Math { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Num_ != 0L) hash ^= Num_.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Num_ != 0L) { output.WriteRawTag(8); @@ -478,6 +532,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Num_ != 0L) { @@ -486,6 +541,7 @@ namespace Math { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Num other) { if (other == null) { return; @@ -495,6 +551,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -512,29 +569,34 @@ namespace Math { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class FibReply : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FibReply()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Math.MathReflection.Descriptor.MessageTypes[4]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibReply() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibReply(FibReply other) : this() { count_ = other.count_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public FibReply Clone() { return new FibReply(this); } @@ -542,6 +604,7 @@ namespace Math { /// Field number for the "count" field. public const int CountFieldNumber = 1; private long count_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long Count { get { return count_; } set { @@ -549,10 +612,12 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as FibReply); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(FibReply other) { if (ReferenceEquals(other, null)) { return false; @@ -564,16 +629,19 @@ namespace Math { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Count != 0L) hash ^= Count.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Count != 0L) { output.WriteRawTag(8); @@ -581,6 +649,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Count != 0L) { @@ -589,6 +658,7 @@ namespace Math { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(FibReply other) { if (other == null) { return; @@ -598,6 +668,7 @@ namespace Math { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 25abc514195..d6ba61e7dc0 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -234,6 +234,7 @@ namespace Math { { return CallInvoker.AsyncClientStreamingCall(__Method_Sum, null, options); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override MathClient NewInstance(ClientBaseConfiguration configuration) { return new MathClient(configuration); diff --git a/src/csharp/Grpc.HealthCheck/Health.cs b/src/csharp/Grpc.HealthCheck/Health.cs index 100ad187d7d..b8e2e2274cb 100644 --- a/src/csharp/Grpc.HealthCheck/Health.cs +++ b/src/csharp/Grpc.HealthCheck/Health.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Health.V1 { /// Holder for reflection information generated from health.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class HealthReflection { #region Descriptor @@ -42,29 +41,34 @@ namespace Grpc.Health.V1 { } #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HealthCheckRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckRequest(HealthCheckRequest other) : this() { service_ = other.service_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckRequest Clone() { return new HealthCheckRequest(this); } @@ -72,6 +76,7 @@ namespace Grpc.Health.V1 { /// Field number for the "service" field. public const int ServiceFieldNumber = 1; private string service_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Service { get { return service_; } set { @@ -79,10 +84,12 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HealthCheckRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HealthCheckRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -94,16 +101,19 @@ namespace Grpc.Health.V1 { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Service.Length != 0) hash ^= Service.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Service.Length != 0) { output.WriteRawTag(10); @@ -111,6 +121,7 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Service.Length != 0) { @@ -119,6 +130,7 @@ namespace Grpc.Health.V1 { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HealthCheckRequest other) { if (other == null) { return; @@ -128,6 +140,7 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -145,29 +158,34 @@ namespace Grpc.Health.V1 { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HealthCheckResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HealthCheckResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Health.V1.HealthReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckResponse(HealthCheckResponse other) : this() { status_ = other.status_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HealthCheckResponse Clone() { return new HealthCheckResponse(this); } @@ -175,6 +193,7 @@ namespace Grpc.Health.V1 { /// Field number for the "status" field. public const int StatusFieldNumber = 1; private global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus status_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Health.V1.HealthCheckResponse.Types.ServingStatus Status { get { return status_; } set { @@ -182,10 +201,12 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HealthCheckResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HealthCheckResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -197,16 +218,19 @@ namespace Grpc.Health.V1 { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Status != 0) hash ^= Status.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Status != 0) { output.WriteRawTag(8); @@ -214,6 +238,7 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Status != 0) { @@ -222,6 +247,7 @@ namespace Grpc.Health.V1 { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HealthCheckResponse other) { if (other == null) { return; @@ -231,6 +257,7 @@ namespace Grpc.Health.V1 { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -248,7 +275,7 @@ namespace Grpc.Health.V1 { #region Nested types /// Container for nested types declared in the HealthCheckResponse message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { public enum ServingStatus { [pbr::OriginalName("UNKNOWN")] Unknown = 0, diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 43eea0f22f5..b2a35a79be9 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -107,6 +107,7 @@ namespace Grpc.Health.V1 { { return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override HealthClient NewInstance(ClientBaseConfiguration configuration) { return new HealthClient(configuration); diff --git a/src/csharp/Grpc.IntegrationTesting/Control.cs b/src/csharp/Grpc.IntegrationTesting/Control.cs index 412f800ff9e..7928b51ba54 100644 --- a/src/csharp/Grpc.IntegrationTesting/Control.cs +++ b/src/csharp/Grpc.IntegrationTesting/Control.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/control.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class ControlReflection { #region Descriptor @@ -71,18 +70,19 @@ namespace Grpc.Testing { "ASgBEhoKEmNsaWVudF9zeXN0ZW1fdGltZRgFIAEoARIYChBjbGllbnRfdXNl", "cl90aW1lGAYgASgBEhIKCmxhdGVuY3lfNTAYByABKAESEgoKbGF0ZW5jeV85", "MBgIIAEoARISCgpsYXRlbmN5Xzk1GAkgASgBEhIKCmxhdGVuY3lfOTkYCiAB", - "KAESEwoLbGF0ZW5jeV85OTkYCyABKAEimAIKDlNjZW5hcmlvUmVzdWx0EigK", + "KAESEwoLbGF0ZW5jeV85OTkYCyABKAEiyAIKDlNjZW5hcmlvUmVzdWx0EigK", "CHNjZW5hcmlvGAEgASgLMhYuZ3JwYy50ZXN0aW5nLlNjZW5hcmlvEi4KCWxh", "dGVuY2llcxgCIAEoCzIbLmdycGMudGVzdGluZy5IaXN0b2dyYW1EYXRhEi8K", "DGNsaWVudF9zdGF0cxgDIAMoCzIZLmdycGMudGVzdGluZy5DbGllbnRTdGF0", "cxIvCgxzZXJ2ZXJfc3RhdHMYBCADKAsyGS5ncnBjLnRlc3RpbmcuU2VydmVy", "U3RhdHMSFAoMc2VydmVyX2NvcmVzGAUgAygFEjQKB3N1bW1hcnkYBiABKAsy", - "Iy5ncnBjLnRlc3RpbmcuU2NlbmFyaW9SZXN1bHRTdW1tYXJ5KkEKCkNsaWVu", - "dFR5cGUSDwoLU1lOQ19DTElFTlQQABIQCgxBU1lOQ19DTElFTlQQARIQCgxP", - "VEhFUl9DTElFTlQQAipbCgpTZXJ2ZXJUeXBlEg8KC1NZTkNfU0VSVkVSEAAS", - "EAoMQVNZTkNfU0VSVkVSEAESGAoUQVNZTkNfR0VORVJJQ19TRVJWRVIQAhIQ", - "CgxPVEhFUl9TRVJWRVIQAyojCgdScGNUeXBlEgkKBVVOQVJZEAASDQoJU1RS", - "RUFNSU5HEAFiBnByb3RvMw==")); + "Iy5ncnBjLnRlc3RpbmcuU2NlbmFyaW9SZXN1bHRTdW1tYXJ5EhYKDmNsaWVu", + "dF9zdWNjZXNzGAcgAygIEhYKDnNlcnZlcl9zdWNjZXNzGAggAygIKkEKCkNs", + "aWVudFR5cGUSDwoLU1lOQ19DTElFTlQQABIQCgxBU1lOQ19DTElFTlQQARIQ", + "CgxPVEhFUl9DTElFTlQQAipbCgpTZXJ2ZXJUeXBlEg8KC1NZTkNfU0VSVkVS", + "EAASEAoMQVNZTkNfU0VSVkVSEAESGAoUQVNZTkNfR0VORVJJQ19TRVJWRVIQ", + "AhIQCgxPVEhFUl9TRVJWRVIQAyojCgdScGNUeXBlEgkKBVVOQVJZEAASDQoJ", + "U1RSRUFNSU5HEAFiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Grpc.Testing.PayloadsReflection.Descriptor, global::Grpc.Testing.StatsReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Grpc.Testing.ClientType), typeof(global::Grpc.Testing.ServerType), typeof(global::Grpc.Testing.RpcType), }, new pbr::GeneratedClrTypeInfo[] { @@ -103,7 +103,7 @@ namespace Grpc.Testing { new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenario), global::Grpc.Testing.Scenario.Parser, new[]{ "Name", "ClientConfig", "NumClients", "ServerConfig", "NumServers", "WarmupSeconds", "BenchmarkSeconds", "SpawnLocalWorkerCount" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.Scenarios), global::Grpc.Testing.Scenarios.Parser, new[]{ "Scenarios_" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResultSummary), global::Grpc.Testing.ScenarioResultSummary.Parser, new[]{ "Qps", "QpsPerServerCore", "ServerSystemTime", "ServerUserTime", "ClientSystemTime", "ClientUserTime", "Latency50", "Latency90", "Latency95", "Latency99", "Latency999" }, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResult), global::Grpc.Testing.ScenarioResult.Parser, new[]{ "Scenario", "Latencies", "ClientStats", "ServerStats", "ServerCores", "Summary" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Grpc.Testing.ScenarioResult), global::Grpc.Testing.ScenarioResult.Parser, new[]{ "Scenario", "Latencies", "ClientStats", "ServerStats", "ServerCores", "Summary", "ClientSuccess", "ServerSuccess" }, null, null, null) })); } #endregion @@ -145,29 +145,34 @@ namespace Grpc.Testing { /// Parameters of poisson process distribution, which is a good representation /// of activity coming in from independent identical stationary sources. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class PoissonParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PoissonParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PoissonParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PoissonParams(PoissonParams other) : this() { offeredLoad_ = other.offeredLoad_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PoissonParams Clone() { return new PoissonParams(this); } @@ -178,6 +183,7 @@ namespace Grpc.Testing { /// /// The rate of arrivals (a.k.a. lambda parameter of the exp distribution). /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double OfferedLoad { get { return offeredLoad_; } set { @@ -185,10 +191,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as PoissonParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(PoissonParams other) { if (ReferenceEquals(other, null)) { return false; @@ -200,16 +208,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (OfferedLoad != 0D) hash ^= OfferedLoad.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (OfferedLoad != 0D) { output.WriteRawTag(9); @@ -217,6 +228,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (OfferedLoad != 0D) { @@ -225,6 +237,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(PoissonParams other) { if (other == null) { return; @@ -234,6 +247,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -255,36 +269,43 @@ namespace Grpc.Testing { /// Once an RPC finishes, immediately start a new one. /// No configuration parameters needed. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ClosedLoopParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClosedLoopParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClosedLoopParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClosedLoopParams(ClosedLoopParams other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClosedLoopParams Clone() { return new ClosedLoopParams(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClosedLoopParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ClosedLoopParams other) { if (ReferenceEquals(other, null)) { return false; @@ -295,29 +316,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ClosedLoopParams other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -331,25 +358,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class LoadParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new LoadParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public LoadParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public LoadParams(LoadParams other) : this() { switch (other.LoadCase) { case LoadOneofCase.ClosedLoop: @@ -362,12 +393,14 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public LoadParams Clone() { return new LoadParams(this); } /// Field number for the "closed_loop" field. public const int ClosedLoopFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClosedLoopParams ClosedLoop { get { return loadCase_ == LoadOneofCase.ClosedLoop ? (global::Grpc.Testing.ClosedLoopParams) load_ : null; } set { @@ -378,6 +411,7 @@ namespace Grpc.Testing { /// Field number for the "poisson" field. public const int PoissonFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PoissonParams Poisson { get { return loadCase_ == LoadOneofCase.Poisson ? (global::Grpc.Testing.PoissonParams) load_ : null; } set { @@ -394,19 +428,23 @@ namespace Grpc.Testing { Poisson = 2, } private LoadOneofCase loadCase_ = LoadOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public LoadOneofCase LoadCase { get { return loadCase_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearLoad() { loadCase_ = LoadOneofCase.None; load_ = null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as LoadParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(LoadParams other) { if (ReferenceEquals(other, null)) { return false; @@ -420,6 +458,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (loadCase_ == LoadOneofCase.ClosedLoop) hash ^= ClosedLoop.GetHashCode(); @@ -428,10 +467,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (loadCase_ == LoadOneofCase.ClosedLoop) { output.WriteRawTag(10); @@ -443,6 +484,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (loadCase_ == LoadOneofCase.ClosedLoop) { @@ -454,6 +496,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(LoadParams other) { if (other == null) { return; @@ -469,6 +512,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -503,30 +547,35 @@ namespace Grpc.Testing { /// /// presence of SecurityParams implies use of TLS /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SecurityParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SecurityParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[3]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SecurityParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SecurityParams(SecurityParams other) : this() { useTestCa_ = other.useTestCa_; serverHostOverride_ = other.serverHostOverride_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SecurityParams Clone() { return new SecurityParams(this); } @@ -534,6 +583,7 @@ namespace Grpc.Testing { /// Field number for the "use_test_ca" field. public const int UseTestCaFieldNumber = 1; private bool useTestCa_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool UseTestCa { get { return useTestCa_; } set { @@ -544,6 +594,7 @@ namespace Grpc.Testing { /// Field number for the "server_host_override" field. public const int ServerHostOverrideFieldNumber = 2; private string serverHostOverride_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ServerHostOverride { get { return serverHostOverride_; } set { @@ -551,10 +602,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SecurityParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(SecurityParams other) { if (ReferenceEquals(other, null)) { return false; @@ -567,6 +620,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (UseTestCa != false) hash ^= UseTestCa.GetHashCode(); @@ -574,10 +628,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (UseTestCa != false) { output.WriteRawTag(8); @@ -589,6 +645,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (UseTestCa != false) { @@ -600,6 +657,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(SecurityParams other) { if (other == null) { return; @@ -612,6 +670,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -633,25 +692,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ClientConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientConfig()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[4]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientConfig() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientConfig(ClientConfig other) : this() { serverTargets_ = other.serverTargets_.Clone(); clientType_ = other.clientType_; @@ -668,6 +731,7 @@ namespace Grpc.Testing { otherClientApi_ = other.otherClientApi_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientConfig Clone() { return new ClientConfig(this); } @@ -680,6 +744,7 @@ namespace Grpc.Testing { /// /// List of targets to connect to. At least one target needs to be specified. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerTargets { get { return serverTargets_; } } @@ -687,6 +752,7 @@ namespace Grpc.Testing { /// Field number for the "client_type" field. public const int ClientTypeFieldNumber = 2; private global::Grpc.Testing.ClientType clientType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClientType ClientType { get { return clientType_; } set { @@ -697,6 +763,7 @@ namespace Grpc.Testing { /// Field number for the "security_params" field. public const int SecurityParamsFieldNumber = 3; private global::Grpc.Testing.SecurityParams securityParams_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.SecurityParams SecurityParams { get { return securityParams_; } set { @@ -711,6 +778,7 @@ namespace Grpc.Testing { /// How many concurrent RPCs to start for each channel. /// For synchronous client, use a separate thread for each outstanding RPC. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int OutstandingRpcsPerChannel { get { return outstandingRpcsPerChannel_; } set { @@ -725,6 +793,7 @@ namespace Grpc.Testing { /// Number of independent client channels to create. /// i-th channel will connect to server_target[i % server_targets.size()] /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ClientChannels { get { return clientChannels_; } set { @@ -738,6 +807,7 @@ namespace Grpc.Testing { /// /// Only for async client. Number of threads to use to start/manage RPCs. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AsyncClientThreads { get { return asyncClientThreads_; } set { @@ -748,6 +818,7 @@ namespace Grpc.Testing { /// Field number for the "rpc_type" field. public const int RpcTypeFieldNumber = 8; private global::Grpc.Testing.RpcType rpcType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.RpcType RpcType { get { return rpcType_; } set { @@ -761,6 +832,7 @@ namespace Grpc.Testing { /// /// The requested load for the entire client (aggregated over all the threads). /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.LoadParams LoadParams { get { return loadParams_; } set { @@ -771,6 +843,7 @@ namespace Grpc.Testing { /// Field number for the "payload_config" field. public const int PayloadConfigFieldNumber = 11; private global::Grpc.Testing.PayloadConfig payloadConfig_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadConfig PayloadConfig { get { return payloadConfig_; } set { @@ -781,6 +854,7 @@ namespace Grpc.Testing { /// Field number for the "histogram_params" field. public const int HistogramParamsFieldNumber = 12; private global::Grpc.Testing.HistogramParams histogramParams_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.HistogramParams HistogramParams { get { return histogramParams_; } set { @@ -796,6 +870,7 @@ namespace Grpc.Testing { /// /// Specify the cores we should run the client on, if desired /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField CoreList { get { return coreList_; } } @@ -803,6 +878,7 @@ namespace Grpc.Testing { /// Field number for the "core_limit" field. public const int CoreLimitFieldNumber = 14; private int coreLimit_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CoreLimit { get { return coreLimit_; } set { @@ -816,6 +892,7 @@ namespace Grpc.Testing { /// /// If we use an OTHER_CLIENT client_type, this string gives more detail /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OtherClientApi { get { return otherClientApi_; } set { @@ -823,10 +900,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClientConfig); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ClientConfig other) { if (ReferenceEquals(other, null)) { return false; @@ -850,6 +929,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= serverTargets_.GetHashCode(); @@ -868,10 +948,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { serverTargets_.WriteTo(output, _repeated_serverTargets_codec); if (ClientType != 0) { @@ -921,6 +1003,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += serverTargets_.CalculateSize(_repeated_serverTargets_codec); @@ -961,6 +1044,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ClientConfig other) { if (other == null) { return; @@ -1014,6 +1098,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1092,29 +1177,34 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ClientStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientStatus()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[5]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStatus() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStatus(ClientStatus other) : this() { Stats = other.stats_ != null ? other.Stats.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStatus Clone() { return new ClientStatus(this); } @@ -1122,6 +1212,7 @@ namespace Grpc.Testing { /// Field number for the "stats" field. public const int StatsFieldNumber = 1; private global::Grpc.Testing.ClientStats stats_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClientStats Stats { get { return stats_; } set { @@ -1129,10 +1220,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClientStatus); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ClientStatus other) { if (ReferenceEquals(other, null)) { return false; @@ -1144,16 +1237,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (stats_ != null) hash ^= Stats.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (stats_ != null) { output.WriteRawTag(10); @@ -1161,6 +1257,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (stats_ != null) { @@ -1169,6 +1266,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ClientStatus other) { if (other == null) { return; @@ -1181,6 +1279,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1204,29 +1303,34 @@ namespace Grpc.Testing { /// /// Request current stats /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Mark : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Mark()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[6]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Mark() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Mark(Mark other) : this() { reset_ = other.reset_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Mark Clone() { return new Mark(this); } @@ -1237,6 +1341,7 @@ namespace Grpc.Testing { /// /// if true, the stats will be reset after taking their snapshot. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Reset { get { return reset_; } set { @@ -1244,10 +1349,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Mark); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Mark other) { if (ReferenceEquals(other, null)) { return false; @@ -1259,16 +1366,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Reset != false) hash ^= Reset.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Reset != false) { output.WriteRawTag(8); @@ -1276,6 +1386,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Reset != false) { @@ -1284,6 +1395,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Mark other) { if (other == null) { return; @@ -1293,6 +1405,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1310,25 +1423,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ClientArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientArgs()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[7]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientArgs() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientArgs(ClientArgs other) : this() { switch (other.ArgtypeCase) { case ArgtypeOneofCase.Setup: @@ -1341,12 +1458,14 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientArgs Clone() { return new ClientArgs(this); } /// Field number for the "setup" field. public const int SetupFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClientConfig Setup { get { return argtypeCase_ == ArgtypeOneofCase.Setup ? (global::Grpc.Testing.ClientConfig) argtype_ : null; } set { @@ -1357,6 +1476,7 @@ namespace Grpc.Testing { /// Field number for the "mark" field. public const int MarkFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Mark Mark { get { return argtypeCase_ == ArgtypeOneofCase.Mark ? (global::Grpc.Testing.Mark) argtype_ : null; } set { @@ -1373,19 +1493,23 @@ namespace Grpc.Testing { Mark = 2, } private ArgtypeOneofCase argtypeCase_ = ArgtypeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ArgtypeOneofCase ArgtypeCase { get { return argtypeCase_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearArgtype() { argtypeCase_ = ArgtypeOneofCase.None; argtype_ = null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClientArgs); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ClientArgs other) { if (ReferenceEquals(other, null)) { return false; @@ -1399,6 +1523,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (argtypeCase_ == ArgtypeOneofCase.Setup) hash ^= Setup.GetHashCode(); @@ -1407,10 +1532,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (argtypeCase_ == ArgtypeOneofCase.Setup) { output.WriteRawTag(10); @@ -1422,6 +1549,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (argtypeCase_ == ArgtypeOneofCase.Setup) { @@ -1433,6 +1561,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ClientArgs other) { if (other == null) { return; @@ -1448,6 +1577,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1479,25 +1609,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ServerConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerConfig()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[8]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerConfig() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerConfig(ServerConfig other) : this() { serverType_ = other.serverType_; SecurityParams = other.securityParams_ != null ? other.SecurityParams.Clone() : null; @@ -1509,6 +1643,7 @@ namespace Grpc.Testing { otherServerApi_ = other.otherServerApi_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerConfig Clone() { return new ServerConfig(this); } @@ -1516,6 +1651,7 @@ namespace Grpc.Testing { /// Field number for the "server_type" field. public const int ServerTypeFieldNumber = 1; private global::Grpc.Testing.ServerType serverType_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ServerType ServerType { get { return serverType_; } set { @@ -1526,6 +1662,7 @@ namespace Grpc.Testing { /// Field number for the "security_params" field. public const int SecurityParamsFieldNumber = 2; private global::Grpc.Testing.SecurityParams securityParams_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.SecurityParams SecurityParams { get { return securityParams_; } set { @@ -1539,6 +1676,7 @@ namespace Grpc.Testing { /// /// Port on which to listen. Zero means pick unused port. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Port { get { return port_; } set { @@ -1552,6 +1690,7 @@ namespace Grpc.Testing { /// /// Only for async server. Number of threads used to serve the requests. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AsyncServerThreads { get { return asyncServerThreads_; } set { @@ -1565,6 +1704,7 @@ namespace Grpc.Testing { /// /// Specify the number of cores to limit server to, if desired /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CoreLimit { get { return coreLimit_; } set { @@ -1578,6 +1718,7 @@ namespace Grpc.Testing { /// /// payload config, used in generic server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadConfig PayloadConfig { get { return payloadConfig_; } set { @@ -1593,6 +1734,7 @@ namespace Grpc.Testing { /// /// Specify the cores we should run the server on, if desired /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField CoreList { get { return coreList_; } } @@ -1603,6 +1745,7 @@ namespace Grpc.Testing { /// /// If we use an OTHER_SERVER client_type, this string gives more detail /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OtherServerApi { get { return otherServerApi_; } set { @@ -1610,10 +1753,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ServerConfig); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ServerConfig other) { if (ReferenceEquals(other, null)) { return false; @@ -1632,6 +1777,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ServerType != 0) hash ^= ServerType.GetHashCode(); @@ -1645,10 +1791,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ServerType != 0) { output.WriteRawTag(8); @@ -1681,6 +1829,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ServerType != 0) { @@ -1708,6 +1857,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ServerConfig other) { if (other == null) { return; @@ -1742,6 +1892,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1794,25 +1945,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ServerArgs : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerArgs()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[9]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerArgs() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerArgs(ServerArgs other) : this() { switch (other.ArgtypeCase) { case ArgtypeOneofCase.Setup: @@ -1825,12 +1980,14 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerArgs Clone() { return new ServerArgs(this); } /// Field number for the "setup" field. public const int SetupFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ServerConfig Setup { get { return argtypeCase_ == ArgtypeOneofCase.Setup ? (global::Grpc.Testing.ServerConfig) argtype_ : null; } set { @@ -1841,6 +1998,7 @@ namespace Grpc.Testing { /// Field number for the "mark" field. public const int MarkFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Mark Mark { get { return argtypeCase_ == ArgtypeOneofCase.Mark ? (global::Grpc.Testing.Mark) argtype_ : null; } set { @@ -1857,19 +2015,23 @@ namespace Grpc.Testing { Mark = 2, } private ArgtypeOneofCase argtypeCase_ = ArgtypeOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ArgtypeOneofCase ArgtypeCase { get { return argtypeCase_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearArgtype() { argtypeCase_ = ArgtypeOneofCase.None; argtype_ = null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ServerArgs); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ServerArgs other) { if (ReferenceEquals(other, null)) { return false; @@ -1883,6 +2045,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (argtypeCase_ == ArgtypeOneofCase.Setup) hash ^= Setup.GetHashCode(); @@ -1891,10 +2054,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (argtypeCase_ == ArgtypeOneofCase.Setup) { output.WriteRawTag(10); @@ -1906,6 +2071,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (argtypeCase_ == ArgtypeOneofCase.Setup) { @@ -1917,6 +2083,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ServerArgs other) { if (other == null) { return; @@ -1932,6 +2099,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1963,31 +2131,36 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ServerStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerStatus()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[10]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStatus() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStatus(ServerStatus other) : this() { Stats = other.stats_ != null ? other.Stats.Clone() : null; port_ = other.port_; cores_ = other.cores_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStatus Clone() { return new ServerStatus(this); } @@ -1995,6 +2168,7 @@ namespace Grpc.Testing { /// Field number for the "stats" field. public const int StatsFieldNumber = 1; private global::Grpc.Testing.ServerStats stats_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ServerStats Stats { get { return stats_; } set { @@ -2008,6 +2182,7 @@ namespace Grpc.Testing { /// /// the port bound by the server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Port { get { return port_; } set { @@ -2021,6 +2196,7 @@ namespace Grpc.Testing { /// /// Number of cores available to the server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Cores { get { return cores_; } set { @@ -2028,10 +2204,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ServerStatus); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ServerStatus other) { if (ReferenceEquals(other, null)) { return false; @@ -2045,6 +2223,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (stats_ != null) hash ^= Stats.GetHashCode(); @@ -2053,10 +2232,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (stats_ != null) { output.WriteRawTag(10); @@ -2072,6 +2253,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (stats_ != null) { @@ -2086,6 +2268,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ServerStatus other) { if (other == null) { return; @@ -2104,6 +2287,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2132,36 +2316,43 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class CoreRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CoreRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[11]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreRequest(CoreRequest other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreRequest Clone() { return new CoreRequest(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as CoreRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(CoreRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -2172,29 +2363,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(CoreRequest other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2208,29 +2405,34 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class CoreResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new CoreResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[12]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreResponse(CoreResponse other) : this() { cores_ = other.cores_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public CoreResponse Clone() { return new CoreResponse(this); } @@ -2241,6 +2443,7 @@ namespace Grpc.Testing { /// /// Number of cores available on the server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Cores { get { return cores_; } set { @@ -2248,10 +2451,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as CoreResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(CoreResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -2263,16 +2468,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Cores != 0) hash ^= Cores.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Cores != 0) { output.WriteRawTag(8); @@ -2280,6 +2488,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Cores != 0) { @@ -2288,6 +2497,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(CoreResponse other) { if (other == null) { return; @@ -2297,6 +2507,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2314,36 +2525,43 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Void : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Void()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[13]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Void() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Void(Void other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Void Clone() { return new Void(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Void); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Void other) { if (ReferenceEquals(other, null)) { return false; @@ -2354,29 +2572,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Void other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2393,25 +2617,29 @@ namespace Grpc.Testing { /// /// A single performance scenario: input to qps_json_driver /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Scenario : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenario()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[14]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenario() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenario(Scenario other) : this() { name_ = other.name_; ClientConfig = other.clientConfig_ != null ? other.ClientConfig.Clone() : null; @@ -2423,6 +2651,7 @@ namespace Grpc.Testing { spawnLocalWorkerCount_ = other.spawnLocalWorkerCount_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenario Clone() { return new Scenario(this); } @@ -2433,6 +2662,7 @@ namespace Grpc.Testing { /// /// Human readable name for this scenario /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -2446,6 +2676,7 @@ namespace Grpc.Testing { /// /// Client configuration /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ClientConfig ClientConfig { get { return clientConfig_; } set { @@ -2459,6 +2690,7 @@ namespace Grpc.Testing { /// /// Number of clients to start for the test /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int NumClients { get { return numClients_; } set { @@ -2472,6 +2704,7 @@ namespace Grpc.Testing { /// /// Server configuration /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ServerConfig ServerConfig { get { return serverConfig_; } set { @@ -2485,6 +2718,7 @@ namespace Grpc.Testing { /// /// Number of servers to start for the test /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int NumServers { get { return numServers_; } set { @@ -2498,6 +2732,7 @@ namespace Grpc.Testing { /// /// Warmup period, in seconds /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int WarmupSeconds { get { return warmupSeconds_; } set { @@ -2511,6 +2746,7 @@ namespace Grpc.Testing { /// /// Benchmark time, in seconds /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int BenchmarkSeconds { get { return benchmarkSeconds_; } set { @@ -2524,6 +2760,7 @@ namespace Grpc.Testing { /// /// Number of workers to spawn locally (usually zero) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int SpawnLocalWorkerCount { get { return spawnLocalWorkerCount_; } set { @@ -2531,10 +2768,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Scenario); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Scenario other) { if (ReferenceEquals(other, null)) { return false; @@ -2553,6 +2792,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -2566,10 +2806,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -2605,6 +2847,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -2634,6 +2877,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Scenario other) { if (other == null) { return; @@ -2670,6 +2914,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2724,29 +2969,34 @@ namespace Grpc.Testing { /// /// A set of scenarios to be run with qps_json_driver /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Scenarios : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Scenarios()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[15]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenarios() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenarios(Scenarios other) : this() { scenarios_ = other.scenarios_.Clone(); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Scenarios Clone() { return new Scenarios(this); } @@ -2756,14 +3006,17 @@ namespace Grpc.Testing { private static readonly pb::FieldCodec _repeated_scenarios_codec = pb::FieldCodec.ForMessage(10, global::Grpc.Testing.Scenario.Parser); private readonly pbc::RepeatedField scenarios_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Scenarios_ { get { return scenarios_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Scenarios); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Scenarios other) { if (ReferenceEquals(other, null)) { return false; @@ -2775,26 +3028,31 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= scenarios_.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { scenarios_.WriteTo(output, _repeated_scenarios_codec); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += scenarios_.CalculateSize(_repeated_scenarios_codec); return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Scenarios other) { if (other == null) { return; @@ -2802,6 +3060,7 @@ namespace Grpc.Testing { scenarios_.Add(other.scenarios_); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -2823,25 +3082,29 @@ namespace Grpc.Testing { /// Basic summary that can be computed from ClientStats and ServerStats /// once the scenario has finished. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ScenarioResultSummary : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResultSummary()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[16]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResultSummary() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResultSummary(ScenarioResultSummary other) : this() { qps_ = other.qps_; qpsPerServerCore_ = other.qpsPerServerCore_; @@ -2856,6 +3119,7 @@ namespace Grpc.Testing { latency999_ = other.latency999_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResultSummary Clone() { return new ScenarioResultSummary(this); } @@ -2866,6 +3130,7 @@ namespace Grpc.Testing { /// /// Total number of operations per second over all clients. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Qps { get { return qps_; } set { @@ -2879,6 +3144,7 @@ namespace Grpc.Testing { /// /// QPS per one server core. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double QpsPerServerCore { get { return qpsPerServerCore_; } set { @@ -2892,6 +3158,7 @@ namespace Grpc.Testing { /// /// server load based on system_time (0.85 => 85%) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ServerSystemTime { get { return serverSystemTime_; } set { @@ -2905,6 +3172,7 @@ namespace Grpc.Testing { /// /// server load based on user_time (0.85 => 85%) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ServerUserTime { get { return serverUserTime_; } set { @@ -2918,6 +3186,7 @@ namespace Grpc.Testing { /// /// client load based on system_time (0.85 => 85%) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ClientSystemTime { get { return clientSystemTime_; } set { @@ -2931,6 +3200,7 @@ namespace Grpc.Testing { /// /// client load based on user_time (0.85 => 85%) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double ClientUserTime { get { return clientUserTime_; } set { @@ -2944,6 +3214,7 @@ namespace Grpc.Testing { /// /// X% latency percentiles (in nanoseconds) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency50 { get { return latency50_; } set { @@ -2954,6 +3225,7 @@ namespace Grpc.Testing { /// Field number for the "latency_90" field. public const int Latency90FieldNumber = 8; private double latency90_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency90 { get { return latency90_; } set { @@ -2964,6 +3236,7 @@ namespace Grpc.Testing { /// Field number for the "latency_95" field. public const int Latency95FieldNumber = 9; private double latency95_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency95 { get { return latency95_; } set { @@ -2974,6 +3247,7 @@ namespace Grpc.Testing { /// Field number for the "latency_99" field. public const int Latency99FieldNumber = 10; private double latency99_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency99 { get { return latency99_; } set { @@ -2984,6 +3258,7 @@ namespace Grpc.Testing { /// Field number for the "latency_999" field. public const int Latency999FieldNumber = 11; private double latency999_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Latency999 { get { return latency999_; } set { @@ -2991,10 +3266,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ScenarioResultSummary); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ScenarioResultSummary other) { if (ReferenceEquals(other, null)) { return false; @@ -3016,6 +3293,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Qps != 0D) hash ^= Qps.GetHashCode(); @@ -3032,10 +3310,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Qps != 0D) { output.WriteRawTag(9); @@ -3083,6 +3363,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Qps != 0D) { @@ -3121,6 +3402,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ScenarioResultSummary other) { if (other == null) { return; @@ -3160,6 +3442,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3220,25 +3503,29 @@ namespace Grpc.Testing { /// /// Results of a single benchmark scenario. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ScenarioResult : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ScenarioResult()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.ControlReflection.Descriptor.MessageTypes[17]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResult() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResult(ScenarioResult other) : this() { Scenario = other.scenario_ != null ? other.Scenario.Clone() : null; Latencies = other.latencies_ != null ? other.Latencies.Clone() : null; @@ -3246,8 +3533,11 @@ namespace Grpc.Testing { serverStats_ = other.serverStats_.Clone(); serverCores_ = other.serverCores_.Clone(); Summary = other.summary_ != null ? other.Summary.Clone() : null; + clientSuccess_ = other.clientSuccess_.Clone(); + serverSuccess_ = other.serverSuccess_.Clone(); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ScenarioResult Clone() { return new ScenarioResult(this); } @@ -3258,6 +3548,7 @@ namespace Grpc.Testing { /// /// Inputs used to run the scenario. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Scenario Scenario { get { return scenario_; } set { @@ -3271,6 +3562,7 @@ namespace Grpc.Testing { /// /// Histograms from all clients merged into one histogram. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.HistogramData Latencies { get { return latencies_; } set { @@ -3286,6 +3578,7 @@ namespace Grpc.Testing { /// /// Client stats for each client /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ClientStats { get { return clientStats_; } } @@ -3298,6 +3591,7 @@ namespace Grpc.Testing { /// /// Server stats for each server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerStats { get { return serverStats_; } } @@ -3310,6 +3604,7 @@ namespace Grpc.Testing { /// /// Number of cores available to each server /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ServerCores { get { return serverCores_; } } @@ -3320,6 +3615,7 @@ namespace Grpc.Testing { /// /// An after-the-fact computed summary /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ScenarioResultSummary Summary { get { return summary_; } set { @@ -3327,10 +3623,35 @@ namespace Grpc.Testing { } } + /// Field number for the "client_success" field. + public const int ClientSuccessFieldNumber = 7; + private static readonly pb::FieldCodec _repeated_clientSuccess_codec + = pb::FieldCodec.ForBool(58); + private readonly pbc::RepeatedField clientSuccess_ = new pbc::RepeatedField(); + /// + /// Information on success or failure of each worker + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ClientSuccess { + get { return clientSuccess_; } + } + + /// Field number for the "server_success" field. + public const int ServerSuccessFieldNumber = 8; + private static readonly pb::FieldCodec _repeated_serverSuccess_codec + = pb::FieldCodec.ForBool(66); + private readonly pbc::RepeatedField serverSuccess_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField ServerSuccess { + get { return serverSuccess_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ScenarioResult); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ScenarioResult other) { if (ReferenceEquals(other, null)) { return false; @@ -3344,9 +3665,12 @@ namespace Grpc.Testing { if(!serverStats_.Equals(other.serverStats_)) return false; if(!serverCores_.Equals(other.serverCores_)) return false; if (!object.Equals(Summary, other.Summary)) return false; + if(!clientSuccess_.Equals(other.clientSuccess_)) return false; + if(!serverSuccess_.Equals(other.serverSuccess_)) return false; return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (scenario_ != null) hash ^= Scenario.GetHashCode(); @@ -3355,13 +3679,17 @@ namespace Grpc.Testing { hash ^= serverStats_.GetHashCode(); hash ^= serverCores_.GetHashCode(); if (summary_ != null) hash ^= Summary.GetHashCode(); + hash ^= clientSuccess_.GetHashCode(); + hash ^= serverSuccess_.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (scenario_ != null) { output.WriteRawTag(10); @@ -3378,8 +3706,11 @@ namespace Grpc.Testing { output.WriteRawTag(50); output.WriteMessage(Summary); } + clientSuccess_.WriteTo(output, _repeated_clientSuccess_codec); + serverSuccess_.WriteTo(output, _repeated_serverSuccess_codec); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (scenario_ != null) { @@ -3394,9 +3725,12 @@ namespace Grpc.Testing { if (summary_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Summary); } + size += clientSuccess_.CalculateSize(_repeated_clientSuccess_codec); + size += serverSuccess_.CalculateSize(_repeated_serverSuccess_codec); return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ScenarioResult other) { if (other == null) { return; @@ -3422,8 +3756,11 @@ namespace Grpc.Testing { } Summary.MergeFrom(other.Summary); } + clientSuccess_.Add(other.clientSuccess_); + serverSuccess_.Add(other.serverSuccess_); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -3465,6 +3802,16 @@ namespace Grpc.Testing { input.ReadMessage(summary_); break; } + case 58: + case 56: { + clientSuccess_.AddEntriesFrom(input, _repeated_clientSuccess_codec); + break; + } + case 66: + case 64: { + serverSuccess_.AddEntriesFrom(input, _repeated_serverSuccess_codec); + break; + } } } } diff --git a/src/csharp/Grpc.IntegrationTesting/Empty.cs b/src/csharp/Grpc.IntegrationTesting/Empty.cs index cf1c23fb0fe..3017e664b90 100644 --- a/src/csharp/Grpc.IntegrationTesting/Empty.cs +++ b/src/csharp/Grpc.IntegrationTesting/Empty.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/empty.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class EmptyReflection { #region Descriptor @@ -44,36 +43,43 @@ namespace Grpc.Testing { /// rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { }; /// }; /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Empty : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.EmptyReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Empty() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Empty(Empty other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Empty Clone() { return new Empty(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Empty); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Empty other) { if (ReferenceEquals(other, null)) { return false; @@ -84,29 +90,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Empty other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.IntegrationTesting/Messages.cs b/src/csharp/Grpc.IntegrationTesting/Messages.cs index 1240db128b0..369fe738d6c 100644 --- a/src/csharp/Grpc.IntegrationTesting/Messages.cs +++ b/src/csharp/Grpc.IntegrationTesting/Messages.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/messages.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MessagesReflection { #region Descriptor @@ -94,29 +93,34 @@ namespace Grpc.Testing { /// https://github.com/grpc/grpc/issues/6980 has been fixed. /// import "google/protobuf/wrappers.proto"; /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class BoolValue : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new BoolValue()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public BoolValue() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public BoolValue(BoolValue other) : this() { value_ = other.value_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public BoolValue Clone() { return new BoolValue(this); } @@ -127,6 +131,7 @@ namespace Grpc.Testing { /// /// The bool value. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Value { get { return value_; } set { @@ -134,10 +139,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as BoolValue); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(BoolValue other) { if (ReferenceEquals(other, null)) { return false; @@ -149,16 +156,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Value != false) hash ^= Value.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Value != false) { output.WriteRawTag(8); @@ -166,6 +176,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Value != false) { @@ -174,6 +185,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(BoolValue other) { if (other == null) { return; @@ -183,6 +195,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -203,30 +216,35 @@ namespace Grpc.Testing { /// /// A block of data, to simply increase gRPC message size. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class Payload : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Payload()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Payload() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Payload(Payload other) : this() { type_ = other.type_; body_ = other.body_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Payload Clone() { return new Payload(this); } @@ -238,6 +256,7 @@ namespace Grpc.Testing { /// DEPRECATED, don't use. To be removed shortly. /// The type of data in body. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType Type { get { return type_; } set { @@ -251,6 +270,7 @@ namespace Grpc.Testing { /// /// Primary contents of payload. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString Body { get { return body_; } set { @@ -258,10 +278,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Payload); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Payload other) { if (ReferenceEquals(other, null)) { return false; @@ -274,6 +296,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Type != 0) hash ^= Type.GetHashCode(); @@ -281,10 +304,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Type != 0) { output.WriteRawTag(8); @@ -296,6 +321,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Type != 0) { @@ -307,6 +333,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Payload other) { if (other == null) { return; @@ -319,6 +346,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -344,30 +372,35 @@ namespace Grpc.Testing { /// A protobuf representation for grpc status. This is used by test /// clients to specify a status that the server should attempt to return. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class EchoStatus : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EchoStatus()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EchoStatus() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EchoStatus(EchoStatus other) : this() { code_ = other.code_; message_ = other.message_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EchoStatus Clone() { return new EchoStatus(this); } @@ -375,6 +408,7 @@ namespace Grpc.Testing { /// Field number for the "code" field. public const int CodeFieldNumber = 1; private int code_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Code { get { return code_; } set { @@ -385,6 +419,7 @@ namespace Grpc.Testing { /// Field number for the "message" field. public const int MessageFieldNumber = 2; private string message_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Message { get { return message_; } set { @@ -392,10 +427,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as EchoStatus); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(EchoStatus other) { if (ReferenceEquals(other, null)) { return false; @@ -408,6 +445,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Code != 0) hash ^= Code.GetHashCode(); @@ -415,10 +453,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Code != 0) { output.WriteRawTag(8); @@ -430,6 +470,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Code != 0) { @@ -441,6 +482,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(EchoStatus other) { if (other == null) { return; @@ -453,6 +495,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -477,25 +520,29 @@ namespace Grpc.Testing { /// /// Unary request. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SimpleRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[3]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleRequest(SimpleRequest other) : this() { responseType_ = other.responseType_; responseSize_ = other.responseSize_; @@ -507,6 +554,7 @@ namespace Grpc.Testing { ExpectCompressed = other.expectCompressed_ != null ? other.ExpectCompressed.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleRequest Clone() { return new SimpleRequest(this); } @@ -519,6 +567,7 @@ namespace Grpc.Testing { /// Desired payload type in the response from the server. /// If response_type is RANDOM, server randomly chooses one from other formats. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType ResponseType { get { return responseType_; } set { @@ -532,6 +581,7 @@ namespace Grpc.Testing { /// /// Desired payload size in the response from the server. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ResponseSize { get { return responseSize_; } set { @@ -545,6 +595,7 @@ namespace Grpc.Testing { /// /// Optional input payload sent along with the request. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { get { return payload_; } set { @@ -558,6 +609,7 @@ namespace Grpc.Testing { /// /// Whether SimpleResponse should include username. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool FillUsername { get { return fillUsername_; } set { @@ -571,6 +623,7 @@ namespace Grpc.Testing { /// /// Whether SimpleResponse should include OAuth scope. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool FillOauthScope { get { return fillOauthScope_; } set { @@ -587,6 +640,7 @@ namespace Grpc.Testing { /// implement the full compression tests by introspecting the call to verify /// the response's compression status. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ResponseCompressed { get { return responseCompressed_; } set { @@ -600,6 +654,7 @@ namespace Grpc.Testing { /// /// Whether server should return a given status /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.EchoStatus ResponseStatus { get { return responseStatus_; } set { @@ -613,6 +668,7 @@ namespace Grpc.Testing { /// /// Whether the server should expect this request to be compressed. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ExpectCompressed { get { return expectCompressed_; } set { @@ -620,10 +676,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(SimpleRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -642,6 +700,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ResponseType != 0) hash ^= ResponseType.GetHashCode(); @@ -655,10 +714,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ResponseType != 0) { output.WriteRawTag(8); @@ -694,6 +755,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ResponseType != 0) { @@ -723,6 +785,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(SimpleRequest other) { if (other == null) { return; @@ -765,6 +828,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -825,31 +889,36 @@ namespace Grpc.Testing { /// /// Unary response, as configured by the request. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SimpleResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[4]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleResponse(SimpleResponse other) : this() { Payload = other.payload_ != null ? other.Payload.Clone() : null; username_ = other.username_; oauthScope_ = other.oauthScope_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleResponse Clone() { return new SimpleResponse(this); } @@ -860,6 +929,7 @@ namespace Grpc.Testing { /// /// Payload to increase message size. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { get { return payload_; } set { @@ -874,6 +944,7 @@ namespace Grpc.Testing { /// The user the request came from, for verifying authentication was /// successful when the client expected it. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Username { get { return username_; } set { @@ -887,6 +958,7 @@ namespace Grpc.Testing { /// /// OAuth scope. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OauthScope { get { return oauthScope_; } set { @@ -894,10 +966,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(SimpleResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -911,6 +985,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (payload_ != null) hash ^= Payload.GetHashCode(); @@ -919,10 +994,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (payload_ != null) { output.WriteRawTag(10); @@ -938,6 +1015,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (payload_ != null) { @@ -952,6 +1030,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(SimpleResponse other) { if (other == null) { return; @@ -970,6 +1049,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1001,30 +1081,35 @@ namespace Grpc.Testing { /// /// Client-streaming request. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class StreamingInputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[5]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallRequest(StreamingInputCallRequest other) : this() { Payload = other.payload_ != null ? other.Payload.Clone() : null; ExpectCompressed = other.expectCompressed_ != null ? other.ExpectCompressed.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallRequest Clone() { return new StreamingInputCallRequest(this); } @@ -1035,6 +1120,7 @@ namespace Grpc.Testing { /// /// Optional input payload sent along with the request. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { get { return payload_; } set { @@ -1051,6 +1137,7 @@ namespace Grpc.Testing { /// implement the full compression tests by introspecting the call to verify /// the request's compression status. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue ExpectCompressed { get { return expectCompressed_; } set { @@ -1058,10 +1145,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StreamingInputCallRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StreamingInputCallRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -1074,6 +1163,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (payload_ != null) hash ^= Payload.GetHashCode(); @@ -1081,10 +1171,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (payload_ != null) { output.WriteRawTag(10); @@ -1096,6 +1188,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (payload_ != null) { @@ -1107,6 +1200,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StreamingInputCallRequest other) { if (other == null) { return; @@ -1125,6 +1219,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1155,29 +1250,34 @@ namespace Grpc.Testing { /// /// Client-streaming response. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class StreamingInputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingInputCallResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[6]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallResponse(StreamingInputCallResponse other) : this() { aggregatedPayloadSize_ = other.aggregatedPayloadSize_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingInputCallResponse Clone() { return new StreamingInputCallResponse(this); } @@ -1188,6 +1288,7 @@ namespace Grpc.Testing { /// /// Aggregated size of payloads received from the client. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int AggregatedPayloadSize { get { return aggregatedPayloadSize_; } set { @@ -1195,10 +1296,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StreamingInputCallResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StreamingInputCallResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -1210,16 +1313,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (AggregatedPayloadSize != 0) hash ^= AggregatedPayloadSize.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (AggregatedPayloadSize != 0) { output.WriteRawTag(8); @@ -1227,6 +1333,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (AggregatedPayloadSize != 0) { @@ -1235,6 +1342,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StreamingInputCallResponse other) { if (other == null) { return; @@ -1244,6 +1352,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1264,31 +1373,36 @@ namespace Grpc.Testing { /// /// Configuration for a particular response. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ResponseParameters : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ResponseParameters()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[7]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ResponseParameters() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ResponseParameters(ResponseParameters other) : this() { size_ = other.size_; intervalUs_ = other.intervalUs_; Compressed = other.compressed_ != null ? other.Compressed.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ResponseParameters Clone() { return new ResponseParameters(this); } @@ -1299,6 +1413,7 @@ namespace Grpc.Testing { /// /// Desired payload sizes in responses from the server. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int Size { get { return size_; } set { @@ -1313,6 +1428,7 @@ namespace Grpc.Testing { /// Desired interval between consecutive responses in the response stream in /// microseconds. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int IntervalUs { get { return intervalUs_; } set { @@ -1329,6 +1445,7 @@ namespace Grpc.Testing { /// implement the full compression tests by introspecting the call to verify /// the response's compression status. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.BoolValue Compressed { get { return compressed_; } set { @@ -1336,10 +1453,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ResponseParameters); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ResponseParameters other) { if (ReferenceEquals(other, null)) { return false; @@ -1353,6 +1472,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Size != 0) hash ^= Size.GetHashCode(); @@ -1361,10 +1481,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Size != 0) { output.WriteRawTag(8); @@ -1380,6 +1502,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Size != 0) { @@ -1394,6 +1517,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ResponseParameters other) { if (other == null) { return; @@ -1412,6 +1536,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1443,25 +1568,29 @@ namespace Grpc.Testing { /// /// Server-streaming request. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class StreamingOutputCallRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[8]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallRequest(StreamingOutputCallRequest other) : this() { responseType_ = other.responseType_; responseParameters_ = other.responseParameters_.Clone(); @@ -1469,6 +1598,7 @@ namespace Grpc.Testing { ResponseStatus = other.responseStatus_ != null ? other.ResponseStatus.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallRequest Clone() { return new StreamingOutputCallRequest(this); } @@ -1483,6 +1613,7 @@ namespace Grpc.Testing { /// might be of different types. This is to simulate a mixed type of payload /// stream. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.PayloadType ResponseType { get { return responseType_; } set { @@ -1498,6 +1629,7 @@ namespace Grpc.Testing { /// /// Configuration for each expected response message. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField ResponseParameters { get { return responseParameters_; } } @@ -1508,6 +1640,7 @@ namespace Grpc.Testing { /// /// Optional input payload sent along with the request. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { get { return payload_; } set { @@ -1521,6 +1654,7 @@ namespace Grpc.Testing { /// /// Whether server should return a given status /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.EchoStatus ResponseStatus { get { return responseStatus_; } set { @@ -1528,10 +1662,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StreamingOutputCallRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StreamingOutputCallRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -1546,6 +1682,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ResponseType != 0) hash ^= ResponseType.GetHashCode(); @@ -1555,10 +1692,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ResponseType != 0) { output.WriteRawTag(8); @@ -1575,6 +1714,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ResponseType != 0) { @@ -1590,6 +1730,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StreamingOutputCallRequest other) { if (other == null) { return; @@ -1612,6 +1753,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1650,29 +1792,34 @@ namespace Grpc.Testing { /// /// Server-streaming response, as configured by the request and parameters. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class StreamingOutputCallResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new StreamingOutputCallResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[9]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallResponse(StreamingOutputCallResponse other) : this() { Payload = other.payload_ != null ? other.Payload.Clone() : null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StreamingOutputCallResponse Clone() { return new StreamingOutputCallResponse(this); } @@ -1683,6 +1830,7 @@ namespace Grpc.Testing { /// /// Payload to increase response size. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.Payload Payload { get { return payload_; } set { @@ -1690,10 +1838,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StreamingOutputCallResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StreamingOutputCallResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -1705,16 +1855,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (payload_ != null) hash ^= Payload.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (payload_ != null) { output.WriteRawTag(10); @@ -1722,6 +1875,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (payload_ != null) { @@ -1730,6 +1884,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StreamingOutputCallResponse other) { if (other == null) { return; @@ -1742,6 +1897,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1766,29 +1922,34 @@ namespace Grpc.Testing { /// For reconnect interop test only. /// Client tells server what reconnection parameters it used. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ReconnectParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[10]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectParams(ReconnectParams other) : this() { maxReconnectBackoffMs_ = other.maxReconnectBackoffMs_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectParams Clone() { return new ReconnectParams(this); } @@ -1796,6 +1957,7 @@ namespace Grpc.Testing { /// Field number for the "max_reconnect_backoff_ms" field. public const int MaxReconnectBackoffMsFieldNumber = 1; private int maxReconnectBackoffMs_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int MaxReconnectBackoffMs { get { return maxReconnectBackoffMs_; } set { @@ -1803,10 +1965,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ReconnectParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ReconnectParams other) { if (ReferenceEquals(other, null)) { return false; @@ -1818,16 +1982,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (MaxReconnectBackoffMs != 0) hash ^= MaxReconnectBackoffMs.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (MaxReconnectBackoffMs != 0) { output.WriteRawTag(8); @@ -1835,6 +2002,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (MaxReconnectBackoffMs != 0) { @@ -1843,6 +2011,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ReconnectParams other) { if (other == null) { return; @@ -1852,6 +2021,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -1874,30 +2044,35 @@ namespace Grpc.Testing { /// Server tells client whether its reconnects are following the spec and the /// reconnect backoffs it saw. /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ReconnectInfo : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ReconnectInfo()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[11]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectInfo() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectInfo(ReconnectInfo other) : this() { passed_ = other.passed_; backoffMs_ = other.backoffMs_.Clone(); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ReconnectInfo Clone() { return new ReconnectInfo(this); } @@ -1905,6 +2080,7 @@ namespace Grpc.Testing { /// Field number for the "passed" field. public const int PassedFieldNumber = 1; private bool passed_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Passed { get { return passed_; } set { @@ -1917,14 +2093,17 @@ namespace Grpc.Testing { private static readonly pb::FieldCodec _repeated_backoffMs_codec = pb::FieldCodec.ForInt32(18); private readonly pbc::RepeatedField backoffMs_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField BackoffMs { get { return backoffMs_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ReconnectInfo); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ReconnectInfo other) { if (ReferenceEquals(other, null)) { return false; @@ -1937,6 +2116,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Passed != false) hash ^= Passed.GetHashCode(); @@ -1944,10 +2124,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Passed != false) { output.WriteRawTag(8); @@ -1956,6 +2138,7 @@ namespace Grpc.Testing { backoffMs_.WriteTo(output, _repeated_backoffMs_codec); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Passed != false) { @@ -1965,6 +2148,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ReconnectInfo other) { if (other == null) { return; @@ -1975,6 +2159,7 @@ namespace Grpc.Testing { backoffMs_.Add(other.backoffMs_); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.IntegrationTesting/Metrics.cs b/src/csharp/Grpc.IntegrationTesting/Metrics.cs index 8f31fbc2a99..4de1847e5fb 100644 --- a/src/csharp/Grpc.IntegrationTesting/Metrics.cs +++ b/src/csharp/Grpc.IntegrationTesting/Metrics.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/metrics.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class MetricsReflection { #region Descriptor @@ -47,25 +46,29 @@ namespace Grpc.Testing { /// /// Reponse message containing the gauge name and value /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class GaugeResponse : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeResponse()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeResponse() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeResponse(GaugeResponse other) : this() { name_ = other.name_; switch (other.ValueCase) { @@ -82,6 +85,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeResponse Clone() { return new GaugeResponse(this); } @@ -89,6 +93,7 @@ namespace Grpc.Testing { /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -98,6 +103,7 @@ namespace Grpc.Testing { /// Field number for the "long_value" field. public const int LongValueFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public long LongValue { get { return valueCase_ == ValueOneofCase.LongValue ? (long) value_ : 0L; } set { @@ -108,6 +114,7 @@ namespace Grpc.Testing { /// Field number for the "double_value" field. public const int DoubleValueFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double DoubleValue { get { return valueCase_ == ValueOneofCase.DoubleValue ? (double) value_ : 0D; } set { @@ -118,6 +125,7 @@ namespace Grpc.Testing { /// Field number for the "string_value" field. public const int StringValueFieldNumber = 4; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string StringValue { get { return valueCase_ == ValueOneofCase.StringValue ? (string) value_ : ""; } set { @@ -135,19 +143,23 @@ namespace Grpc.Testing { StringValue = 4, } private ValueOneofCase valueCase_ = ValueOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ValueOneofCase ValueCase { get { return valueCase_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearValue() { valueCase_ = ValueOneofCase.None; value_ = null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as GaugeResponse); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(GaugeResponse other) { if (ReferenceEquals(other, null)) { return false; @@ -163,6 +175,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); @@ -173,10 +186,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -196,6 +211,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -213,6 +229,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(GaugeResponse other) { if (other == null) { return; @@ -234,6 +251,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -266,29 +284,34 @@ namespace Grpc.Testing { /// /// Request message containing the gauge name /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class GaugeRequest : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new GaugeRequest()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeRequest() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeRequest(GaugeRequest other) : this() { name_ = other.name_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public GaugeRequest Clone() { return new GaugeRequest(this); } @@ -296,6 +319,7 @@ namespace Grpc.Testing { /// Field number for the "name" field. public const int NameFieldNumber = 1; private string name_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { get { return name_; } set { @@ -303,10 +327,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as GaugeRequest); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(GaugeRequest other) { if (ReferenceEquals(other, null)) { return false; @@ -318,16 +344,19 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Name.Length != 0) hash ^= Name.GetHashCode(); return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Name.Length != 0) { output.WriteRawTag(10); @@ -335,6 +364,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Name.Length != 0) { @@ -343,6 +373,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(GaugeRequest other) { if (other == null) { return; @@ -352,6 +383,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -369,36 +401,43 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class EmptyMessage : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new EmptyMessage()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.MetricsReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EmptyMessage() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EmptyMessage(EmptyMessage other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public EmptyMessage Clone() { return new EmptyMessage(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as EmptyMessage); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(EmptyMessage other) { if (ReferenceEquals(other, null)) { return false; @@ -409,29 +448,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(EmptyMessage other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index 040798e3c21..bcd7e3c040a 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -161,6 +161,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncUnaryCall(__Method_GetGauge, null, options, request); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override MetricsServiceClient NewInstance(ClientBaseConfiguration configuration) { return new MetricsServiceClient(configuration); diff --git a/src/csharp/Grpc.IntegrationTesting/Payloads.cs b/src/csharp/Grpc.IntegrationTesting/Payloads.cs index 3ad7a44f4b4..7aef35cda31 100644 --- a/src/csharp/Grpc.IntegrationTesting/Payloads.cs +++ b/src/csharp/Grpc.IntegrationTesting/Payloads.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/payloads.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class PayloadsReflection { #region Descriptor @@ -45,30 +44,35 @@ namespace Grpc.Testing { } #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ByteBufferParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ByteBufferParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ByteBufferParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ByteBufferParams(ByteBufferParams other) : this() { reqSize_ = other.reqSize_; respSize_ = other.respSize_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ByteBufferParams Clone() { return new ByteBufferParams(this); } @@ -76,6 +80,7 @@ namespace Grpc.Testing { /// Field number for the "req_size" field. public const int ReqSizeFieldNumber = 1; private int reqSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ReqSize { get { return reqSize_; } set { @@ -86,6 +91,7 @@ namespace Grpc.Testing { /// Field number for the "resp_size" field. public const int RespSizeFieldNumber = 2; private int respSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int RespSize { get { return respSize_; } set { @@ -93,10 +99,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ByteBufferParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ByteBufferParams other) { if (ReferenceEquals(other, null)) { return false; @@ -109,6 +117,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ReqSize != 0) hash ^= ReqSize.GetHashCode(); @@ -116,10 +125,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ReqSize != 0) { output.WriteRawTag(8); @@ -131,6 +142,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ReqSize != 0) { @@ -142,6 +154,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ByteBufferParams other) { if (other == null) { return; @@ -154,6 +167,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -175,30 +189,35 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class SimpleProtoParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new SimpleProtoParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleProtoParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleProtoParams(SimpleProtoParams other) : this() { reqSize_ = other.reqSize_; respSize_ = other.respSize_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public SimpleProtoParams Clone() { return new SimpleProtoParams(this); } @@ -206,6 +225,7 @@ namespace Grpc.Testing { /// Field number for the "req_size" field. public const int ReqSizeFieldNumber = 1; private int reqSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int ReqSize { get { return reqSize_; } set { @@ -216,6 +236,7 @@ namespace Grpc.Testing { /// Field number for the "resp_size" field. public const int RespSizeFieldNumber = 2; private int respSize_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int RespSize { get { return respSize_; } set { @@ -223,10 +244,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as SimpleProtoParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(SimpleProtoParams other) { if (ReferenceEquals(other, null)) { return false; @@ -239,6 +262,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ReqSize != 0) hash ^= ReqSize.GetHashCode(); @@ -246,10 +270,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ReqSize != 0) { output.WriteRawTag(8); @@ -261,6 +287,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ReqSize != 0) { @@ -272,6 +299,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(SimpleProtoParams other) { if (other == null) { return; @@ -284,6 +312,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -309,36 +338,43 @@ namespace Grpc.Testing { /// TODO (vpai): Fill this in once the details of complex, representative /// protos are decided /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ComplexProtoParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ComplexProtoParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ComplexProtoParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ComplexProtoParams(ComplexProtoParams other) : this() { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ComplexProtoParams Clone() { return new ComplexProtoParams(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ComplexProtoParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ComplexProtoParams other) { if (ReferenceEquals(other, null)) { return false; @@ -349,29 +385,35 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ComplexProtoParams other) { if (other == null) { return; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -385,25 +427,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class PayloadConfig : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new PayloadConfig()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.PayloadsReflection.Descriptor.MessageTypes[3]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PayloadConfig() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PayloadConfig(PayloadConfig other) : this() { switch (other.PayloadCase) { case PayloadOneofCase.BytebufParams: @@ -419,12 +465,14 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PayloadConfig Clone() { return new PayloadConfig(this); } /// Field number for the "bytebuf_params" field. public const int BytebufParamsFieldNumber = 1; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ByteBufferParams BytebufParams { get { return payloadCase_ == PayloadOneofCase.BytebufParams ? (global::Grpc.Testing.ByteBufferParams) payload_ : null; } set { @@ -435,6 +483,7 @@ namespace Grpc.Testing { /// Field number for the "simple_params" field. public const int SimpleParamsFieldNumber = 2; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.SimpleProtoParams SimpleParams { get { return payloadCase_ == PayloadOneofCase.SimpleParams ? (global::Grpc.Testing.SimpleProtoParams) payload_ : null; } set { @@ -445,6 +494,7 @@ namespace Grpc.Testing { /// Field number for the "complex_params" field. public const int ComplexParamsFieldNumber = 3; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.ComplexProtoParams ComplexParams { get { return payloadCase_ == PayloadOneofCase.ComplexParams ? (global::Grpc.Testing.ComplexProtoParams) payload_ : null; } set { @@ -462,19 +512,23 @@ namespace Grpc.Testing { ComplexParams = 3, } private PayloadOneofCase payloadCase_ = PayloadOneofCase.None; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public PayloadOneofCase PayloadCase { get { return payloadCase_; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearPayload() { payloadCase_ = PayloadOneofCase.None; payload_ = null; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as PayloadConfig); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(PayloadConfig other) { if (ReferenceEquals(other, null)) { return false; @@ -489,6 +543,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (payloadCase_ == PayloadOneofCase.BytebufParams) hash ^= BytebufParams.GetHashCode(); @@ -498,10 +553,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (payloadCase_ == PayloadOneofCase.BytebufParams) { output.WriteRawTag(10); @@ -517,6 +574,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (payloadCase_ == PayloadOneofCase.BytebufParams) { @@ -531,6 +589,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(PayloadConfig other) { if (other == null) { return; @@ -549,6 +608,7 @@ namespace Grpc.Testing { } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.IntegrationTesting/Services.cs b/src/csharp/Grpc.IntegrationTesting/Services.cs index e10b45c9a28..bf36a0253b5 100644 --- a/src/csharp/Grpc.IntegrationTesting/Services.cs +++ b/src/csharp/Grpc.IntegrationTesting/Services.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/services.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class ServicesReflection { #region Descriptor diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs index e205dea93ea..848dd04fa78 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs @@ -161,6 +161,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncDuplexStreamingCall(__Method_StreamingCall, null, options); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override BenchmarkServiceClient NewInstance(ClientBaseConfiguration configuration) { return new BenchmarkServiceClient(configuration); @@ -396,6 +397,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncUnaryCall(__Method_QuitWorker, null, options, request); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override WorkerServiceClient NewInstance(ClientBaseConfiguration configuration) { return new WorkerServiceClient(configuration); diff --git a/src/csharp/Grpc.IntegrationTesting/Stats.cs b/src/csharp/Grpc.IntegrationTesting/Stats.cs index 304d676113e..0ae77cfb922 100644 --- a/src/csharp/Grpc.IntegrationTesting/Stats.cs +++ b/src/csharp/Grpc.IntegrationTesting/Stats.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/stats.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class StatsReflection { #region Descriptor @@ -46,31 +45,36 @@ namespace Grpc.Testing { } #region Messages - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ServerStats : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerStats()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[0]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStats() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStats(ServerStats other) : this() { timeElapsed_ = other.timeElapsed_; timeUser_ = other.timeUser_; timeSystem_ = other.timeSystem_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ServerStats Clone() { return new ServerStats(this); } @@ -81,6 +85,7 @@ namespace Grpc.Testing { /// /// wall clock time change in seconds since last reset /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeElapsed { get { return timeElapsed_; } set { @@ -94,6 +99,7 @@ namespace Grpc.Testing { /// /// change in user time (in seconds) used by the server since last reset /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeUser { get { return timeUser_; } set { @@ -108,6 +114,7 @@ namespace Grpc.Testing { /// change in server time (in seconds) used by the server process and all /// threads since last reset /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeSystem { get { return timeSystem_; } set { @@ -115,10 +122,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ServerStats); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ServerStats other) { if (ReferenceEquals(other, null)) { return false; @@ -132,6 +141,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (TimeElapsed != 0D) hash ^= TimeElapsed.GetHashCode(); @@ -140,10 +150,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (TimeElapsed != 0D) { output.WriteRawTag(9); @@ -159,6 +171,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (TimeElapsed != 0D) { @@ -173,6 +186,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ServerStats other) { if (other == null) { return; @@ -188,6 +202,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -216,30 +231,35 @@ namespace Grpc.Testing { /// /// Histogram params based on grpc/support/histogram.c /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HistogramParams : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramParams()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[1]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramParams() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramParams(HistogramParams other) : this() { resolution_ = other.resolution_; maxPossible_ = other.maxPossible_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramParams Clone() { return new HistogramParams(this); } @@ -250,6 +270,7 @@ namespace Grpc.Testing { /// /// first bucket is [0, 1 + resolution) /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Resolution { get { return resolution_; } set { @@ -263,6 +284,7 @@ namespace Grpc.Testing { /// /// use enough buckets to allow this value /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double MaxPossible { get { return maxPossible_; } set { @@ -270,10 +292,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HistogramParams); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HistogramParams other) { if (ReferenceEquals(other, null)) { return false; @@ -286,6 +310,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Resolution != 0D) hash ^= Resolution.GetHashCode(); @@ -293,10 +318,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Resolution != 0D) { output.WriteRawTag(9); @@ -308,6 +335,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Resolution != 0D) { @@ -319,6 +347,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HistogramParams other) { if (other == null) { return; @@ -331,6 +360,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -355,25 +385,29 @@ namespace Grpc.Testing { /// /// Histogram data based on grpc/support/histogram.c /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class HistogramData : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new HistogramData()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[2]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramData() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramData(HistogramData other) : this() { bucket_ = other.bucket_.Clone(); minSeen_ = other.minSeen_; @@ -383,6 +417,7 @@ namespace Grpc.Testing { count_ = other.count_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public HistogramData Clone() { return new HistogramData(this); } @@ -392,6 +427,7 @@ namespace Grpc.Testing { private static readonly pb::FieldCodec _repeated_bucket_codec = pb::FieldCodec.ForUInt32(10); private readonly pbc::RepeatedField bucket_ = new pbc::RepeatedField(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Bucket { get { return bucket_; } } @@ -399,6 +435,7 @@ namespace Grpc.Testing { /// Field number for the "min_seen" field. public const int MinSeenFieldNumber = 2; private double minSeen_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double MinSeen { get { return minSeen_; } set { @@ -409,6 +446,7 @@ namespace Grpc.Testing { /// Field number for the "max_seen" field. public const int MaxSeenFieldNumber = 3; private double maxSeen_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double MaxSeen { get { return maxSeen_; } set { @@ -419,6 +457,7 @@ namespace Grpc.Testing { /// Field number for the "sum" field. public const int SumFieldNumber = 4; private double sum_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Sum { get { return sum_; } set { @@ -429,6 +468,7 @@ namespace Grpc.Testing { /// Field number for the "sum_of_squares" field. public const int SumOfSquaresFieldNumber = 5; private double sumOfSquares_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double SumOfSquares { get { return sumOfSquares_; } set { @@ -439,6 +479,7 @@ namespace Grpc.Testing { /// Field number for the "count" field. public const int CountFieldNumber = 6; private double count_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Count { get { return count_; } set { @@ -446,10 +487,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as HistogramData); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(HistogramData other) { if (ReferenceEquals(other, null)) { return false; @@ -466,6 +509,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; hash ^= bucket_.GetHashCode(); @@ -477,10 +521,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { bucket_.WriteTo(output, _repeated_bucket_codec); if (MinSeen != 0D) { @@ -505,6 +551,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; size += bucket_.CalculateSize(_repeated_bucket_codec); @@ -526,6 +573,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(HistogramData other) { if (other == null) { return; @@ -548,6 +596,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { @@ -586,25 +635,29 @@ namespace Grpc.Testing { } - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public sealed partial class ClientStats : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ClientStats()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Grpc.Testing.StatsReflection.Descriptor.MessageTypes[3]; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStats() { OnConstruction(); } partial void OnConstruction(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStats(ClientStats other) : this() { Latencies = other.latencies_ != null ? other.Latencies.Clone() : null; timeElapsed_ = other.timeElapsed_; @@ -612,6 +665,7 @@ namespace Grpc.Testing { timeSystem_ = other.timeSystem_; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ClientStats Clone() { return new ClientStats(this); } @@ -622,6 +676,7 @@ namespace Grpc.Testing { /// /// Latency histogram. Data points are in nanoseconds. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::Grpc.Testing.HistogramData Latencies { get { return latencies_; } set { @@ -635,6 +690,7 @@ namespace Grpc.Testing { /// /// See ServerStats for details. /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeElapsed { get { return timeElapsed_; } set { @@ -645,6 +701,7 @@ namespace Grpc.Testing { /// Field number for the "time_user" field. public const int TimeUserFieldNumber = 3; private double timeUser_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeUser { get { return timeUser_; } set { @@ -655,6 +712,7 @@ namespace Grpc.Testing { /// Field number for the "time_system" field. public const int TimeSystemFieldNumber = 4; private double timeSystem_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double TimeSystem { get { return timeSystem_; } set { @@ -662,10 +720,12 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as ClientStats); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(ClientStats other) { if (ReferenceEquals(other, null)) { return false; @@ -680,6 +740,7 @@ namespace Grpc.Testing { return true; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (latencies_ != null) hash ^= Latencies.GetHashCode(); @@ -689,10 +750,12 @@ namespace Grpc.Testing { return hash; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (latencies_ != null) { output.WriteRawTag(10); @@ -712,6 +775,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (latencies_ != null) { @@ -729,6 +793,7 @@ namespace Grpc.Testing { return size; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(ClientStats other) { if (other == null) { return; @@ -750,6 +815,7 @@ namespace Grpc.Testing { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { diff --git a/src/csharp/Grpc.IntegrationTesting/Test.cs b/src/csharp/Grpc.IntegrationTesting/Test.cs index 9258dc185d7..88c2b8a921f 100644 --- a/src/csharp/Grpc.IntegrationTesting/Test.cs +++ b/src/csharp/Grpc.IntegrationTesting/Test.cs @@ -10,7 +10,6 @@ using scg = global::System.Collections.Generic; namespace Grpc.Testing { /// Holder for reflection information generated from src/proto/grpc/testing/test.proto - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public static partial class TestReflection { #region Descriptor diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index 3e149da3e01..61f2ed4015a 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -314,6 +314,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncDuplexStreamingCall(__Method_HalfDuplexCall, null, options); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override TestServiceClient NewInstance(ClientBaseConfiguration configuration) { return new TestServiceClient(configuration); @@ -420,6 +421,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncUnaryCall(__Method_UnimplementedCall, null, options, request); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override UnimplementedServiceClient NewInstance(ClientBaseConfiguration configuration) { return new UnimplementedServiceClient(configuration); @@ -535,6 +537,7 @@ namespace Grpc.Testing { { return CallInvoker.AsyncUnaryCall(__Method_Stop, null, options, request); } + /// Creates a new instance of client from given ClientBaseConfiguration. protected override ReconnectServiceClient NewInstance(ClientBaseConfiguration configuration) { return new ReconnectServiceClient(configuration); From 580e976b5fb23cc394d710a511d896f75fc9ce31 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 17:42:55 +0200 Subject: [PATCH 112/123] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9b0454871c..70cf9fcc30e 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ See [tools/run_tests](tools/run_tests) for more guidance on how to run various t This repository contains source code for gRPC libraries for multiple languages written on top of shared C core library [src/core] (src/core). -Libraries in different languages are in different states of development. We are seeking contributions for all of these libraries. +Libraries in different languages may be in different states of development. We are seeking contributions for all of these libraries. | Language | Source | Status | |-------------------------|-------------------------------------|---------| From 10edbe5485add0cb1b1e4b71045d783f1a1ed3b8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 17:48:59 +0200 Subject: [PATCH 113/123] Update README.md --- src/core/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/core/README.md b/src/core/README.md index 0d8c0d5bd90..62865d0c13e 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -2,7 +2,3 @@ This directory contains source code for shared C library. Libraries in other languages in this repository (C++, Ruby, Python, PHP, NodeJS, Objective-C) are layered on top of this library. - -#Status - -Beta From 7a82301a2ea55fd534bb0e43c68c0d7e94878dff Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 17:55:57 +0200 Subject: [PATCH 114/123] Update README.md --- src/core/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/README.md b/src/core/README.md index 62865d0c13e..44c6f247725 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -1,4 +1,4 @@ #Overview -This directory contains source code for shared C library. Libraries in other languages in this repository (C++, Ruby, +This directory contains source code for C library (a.k.a the *gRPC C core*) that provides all gRPC's core functionality through a low level API. Libraries in other languages in this repository (C++, Ruby, Python, PHP, NodeJS, Objective-C) are layered on top of this library. From 5b2e172e5785bcd73c425192ca3d670a96044d27 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:00:39 +0200 Subject: [PATCH 115/123] Create README.md --- src/compiler/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/compiler/README.md diff --git a/src/compiler/README.md b/src/compiler/README.md new file mode 100644 index 00000000000..a2f49b3cd53 --- /dev/null +++ b/src/compiler/README.md @@ -0,0 +1,4 @@ +#Overview + +This directory contains source code for gRPC protocol buffer compiler (*protoc*) plugins. Along with `protoc`, +these plugins are used to generate gRPC client and server stubs from `.proto` files. From 9cece7ca992c6594ed163dc9996a3f879f3d7a1f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:01:41 +0200 Subject: [PATCH 116/123] Update README.md --- src/cpp/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/cpp/README.md b/src/cpp/README.md index 8c0f85e5ff7..d9b521317a6 100644 --- a/src/cpp/README.md +++ b/src/cpp/README.md @@ -3,10 +3,6 @@ This directory contains source code for C++ implementation of gRPC. -#Status - -Beta - #Pre-requisites ##Linux From 9633bd356f2fd90c1bccf0be58f406316155ca54 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:02:32 +0200 Subject: [PATCH 117/123] Update README.md --- src/csharp/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/csharp/README.md b/src/csharp/README.md index 18d5945a8a1..a04172dad4f 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -4,11 +4,6 @@ gRPC C# A C# implementation of gRPC. -Status ------- - -Beta - PREREQUISITES -------------- From d1395d9a667b43807b6f068eff06f4fb53cf43d0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:03:00 +0200 Subject: [PATCH 118/123] Update README.md --- src/node/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/node/README.md b/src/node/README.md index 15d4c6d02f7..fc407435cd7 100644 --- a/src/node/README.md +++ b/src/node/README.md @@ -1,9 +1,6 @@ [![npm](https://img.shields.io/npm/v/grpc.svg)](https://www.npmjs.com/package/grpc) # Node.js gRPC Library -## Status -Beta - ## PREREQUISITES - `node`: This requires `node` to be installed, version `0.12` or above. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package. From 45775fd8a13a4a92310739672d6eba29a8e8e0e6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:03:47 +0200 Subject: [PATCH 119/123] Update README.md --- src/php/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/php/README.md b/src/php/README.md index 7e9819b256d..f2ad96f7a89 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -3,10 +3,6 @@ This directory contains source code for PHP implementation of gRPC layered on shared C library. -#Status - -GA - ## Environment Prerequisite: From 5d77c964fc881df3f8c2f2cff274b46134d48943 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:04:37 +0200 Subject: [PATCH 120/123] Update README.md --- src/ruby/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ruby/README.md b/src/ruby/README.md index 31795754866..a4d7b56b4ec 100644 --- a/src/ruby/README.md +++ b/src/ruby/README.md @@ -4,11 +4,6 @@ gRPC Ruby A Ruby implementation of gRPC. -Status ------- - -Beta - PREREQUISITES ------------- From 0dc8d354e9546bb15fd5b3342637ed8b1d1cd10d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 12 Oct 2016 18:22:39 +0200 Subject: [PATCH 121/123] Update README.md --- src/csharp/README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/csharp/README.md b/src/csharp/README.md index a04172dad4f..0405ff88a01 100644 --- a/src/csharp/README.md +++ b/src/csharp/README.md @@ -4,6 +4,14 @@ gRPC C# A C# implementation of gRPC. +SUPPORTED PLATFORMS +------------------ + +- .NET Framework 4.5+ (Windows) +- [.NET Core](https://dotnet.github.io/) on Linux, Windows and Mac OS X (starting from version 1.0.1) +- Mono 4+ on Linux, Windows and Mac OS X + + PREREQUISITES -------------- @@ -11,6 +19,7 @@ PREREQUISITES - Linux: Mono 4+, MonoDevelop 5.9+ (with NuGet add-in installed) - Mac OS X: Xamarin Studio 5.9+ + HOW TO USE -------------- @@ -64,12 +73,6 @@ different languages. tools/run_tests/run_tests.py -l csharp ``` -ON .NET CORE SUPPORT ------------------- - -We are committed to providing full support for [.NET Core](https://dotnet.github.io/) in near future, -but currently, the support is for .NET Core is experimental/work-in-progress. - DOCUMENTATION ------------- - [API Reference][] @@ -97,9 +100,7 @@ CONTENTS THE NATIVE DEPENDENCY --------------- -Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. `grpc_csharp_ext` library is a native extension library that facilitates this by wrapping some C core API into a form that's more digestible for P/Invoke. - -Prior to version 0.13, installing `grpc_csharp_ext` was required to make gRPC work on Linux and MacOS. Starting with version 0.13, we have improved the packaging story significantly and precompiled versions of the native library for all supported platforms are now shipped with the NuGet package. Just installing the `Grpc` NuGet package should be the only step needed to use gRPC C#, regardless of your platform (Windows, Linux or Mac) and the bitness (32 or 64bit). +Internally, gRPC C# uses a native library written in C (gRPC C core) and invokes its functionality via P/Invoke. The fact that a native library is used should be fully transparent to the users and just installing the `Grpc.Core` NuGet package is the only step needed to use gRPC C# on all supported platforms. [API Reference]: http://www.grpc.io/grpc/csharp/ [Helloworld Example]: ../../examples/csharp/helloworld From 82d7677ec9104e6e3bf57097591ef322758e6cfb Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Wed, 12 Oct 2016 10:28:31 -0700 Subject: [PATCH 122/123] trivial change to kick off jenkins run --- doc/interop-test-descriptions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/interop-test-descriptions.md b/doc/interop-test-descriptions.md index 97d76191a8f..666af185b9f 100644 --- a/doc/interop-test-descriptions.md +++ b/doc/interop-test-descriptions.md @@ -64,7 +64,7 @@ ensure that the proto serialized to zero bytes.* This test verifies that gRPC requests marked as cacheable use GET verb instead of POST, and that server sets appropriate cache control headers for the response -to be cached by a proxy. This interop test requires that the server is behind +to be cached by a proxy. This test requires that the server is behind a caching proxy. Use of current timestamp in the request prevents accidental cache matches left over from previous tests. From b5299976c14781bc98890a0c2d4b6513804c264e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 12 Oct 2016 14:13:42 -0700 Subject: [PATCH 123/123] Fixed clang-format sanity error --- test/cpp/interop/interop_server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cpp/interop/interop_server.cc b/test/cpp/interop/interop_server.cc index 05af18bc671..58f20aa611a 100644 --- a/test/cpp/interop/interop_server.cc +++ b/test/cpp/interop/interop_server.cc @@ -155,8 +155,9 @@ class TestServiceImpl : public TestService::Service { } // Response contains current timestamp. We ignore everything in the request. - Status CacheableUnaryCall(ServerContext* context, const SimpleRequest* request, - SimpleResponse* response) { + Status CacheableUnaryCall(ServerContext* context, + const SimpleRequest* request, + SimpleResponse* response) { gpr_timespec ts = gpr_now(GPR_CLOCK_PRECISE); std::string timestamp = std::to_string((long long unsigned)ts.tv_nsec); response->mutable_payload()->set_body(timestamp.c_str(), timestamp.size());