From ddf6c49a1766ff9e71ee29449d2c39da6015d940 Mon Sep 17 00:00:00 2001 From: Alex Polcyn Date: Tue, 27 Jun 2017 22:06:35 +0000 Subject: fix byte order of port for srv to host request --- .../filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c index 244b260dfa..9065e33613 100644 --- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c +++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.c @@ -236,12 +236,12 @@ static void on_srv_query_done_cb(void *arg, int status, int timeouts, srv_it = srv_it->next) { if (grpc_ipv6_loopback_available()) { grpc_ares_hostbyname_request *hr = create_hostbyname_request( - r, srv_it->host, srv_it->port, true /* is_balancer */); + r, srv_it->host, htons(srv_it->port), true /* is_balancer */); ares_gethostbyname(*channel, hr->host, AF_INET6, on_hostbyname_done_cb, hr); } grpc_ares_hostbyname_request *hr = create_hostbyname_request( - r, srv_it->host, srv_it->port, true /* is_balancer */); + r, srv_it->host, htons(srv_it->port), true /* is_balancer */); ares_gethostbyname(*channel, hr->host, AF_INET, on_hostbyname_done_cb, hr); grpc_ares_ev_driver_start(&exec_ctx, r->ev_driver); -- cgit v1.2.3 From 16e1f6d18b433b2f69375dfd3e491285b85d2fe6 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 10 Jul 2017 11:08:59 -0700 Subject: Install Node 8 in artifact linux Dockerfiles --- tools/dockerfile/grpc_artifact_linux_x64/Dockerfile | 2 +- tools/dockerfile/grpc_artifact_linux_x86/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile index c667655afb..36a3851367 100644 --- a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile @@ -49,7 +49,7 @@ RUN apt-get update && apt-key update && apt-get install -y \ # Install Node dependencies RUN touch .profile RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash -RUN /bin/bash -l -c "nvm install 4 && npm install -g node-pre-gyp" +RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp" ################## # Python dependencies diff --git a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile index 79f230186f..0630e44a85 100644 --- a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile @@ -49,7 +49,7 @@ RUN apt-get update && apt-key update && apt-get install -y \ # Install Node dependencies RUN touch .profile RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash -RUN /bin/bash -l -c "nvm install 4 && npm install -g node-pre-gyp" +RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp" ################## # Python dependencies -- cgit v1.2.3 From e8b282f3c94f4c40aab922b6e66bf55922d9c5a4 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Tue, 11 Jul 2017 14:55:33 -0700 Subject: Remove python setup from artifact linux Dockerfiles --- tools/dockerfile/grpc_artifact_linux_x64/Dockerfile | 12 ------------ tools/dockerfile/grpc_artifact_linux_x86/Dockerfile | 12 ------------ 2 files changed, 24 deletions(-) diff --git a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile index 36a3851367..0251b2b392 100644 --- a/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x64/Dockerfile @@ -51,18 +51,6 @@ RUN touch .profile RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp" -################## -# Python dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-pip - -RUN pip install pip --upgrade -RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 - ################## # Ruby dependencies diff --git a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile index 0630e44a85..2d179c8c45 100644 --- a/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_linux_x86/Dockerfile @@ -51,18 +51,6 @@ RUN touch .profile RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash RUN /bin/bash -l -c "nvm install 8 && npm install -g node-pre-gyp" -################## -# Python dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-pip - -RUN pip install pip --upgrade -RUN pip install virtualenv -RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.2.0 - ################## # Ruby dependencies -- cgit v1.2.3 From ecfe2d6ca605c71629ea2f01a9321e821de3a784 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 12 Jul 2017 18:10:56 -0700 Subject: RR: fix subchannel list handling --- .../lb_policy/round_robin/round_robin.c | 64 +++++++++++++++------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c index fbef79ec31..dfd2b513b1 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c @@ -170,9 +170,9 @@ static void rr_subchannel_list_ref(rr_subchannel_list *subchannel_list, gpr_ref_non_zero(&subchannel_list->refcount); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_INFO, "[RR %p] subchannel_list %p REF %lu->%lu", + gpr_log(GPR_INFO, "[RR %p] subchannel_list %p REF %lu->%lu (%s)", (void *)subchannel_list->policy, (void *)subchannel_list, - (unsigned long)(count - 1), (unsigned long)count); + (unsigned long)(count - 1), (unsigned long)count, reason); } } @@ -182,9 +182,9 @@ static void rr_subchannel_list_unref(grpc_exec_ctx *exec_ctx, const bool done = gpr_unref(&subchannel_list->refcount); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { const gpr_atm count = gpr_atm_acq_load(&subchannel_list->refcount.count); - gpr_log(GPR_INFO, "[RR %p] subchannel_list %p UNREF %lu->%lu", + gpr_log(GPR_INFO, "[RR %p] subchannel_list %p UNREF %lu->%lu (%s)", (void *)subchannel_list->policy, (void *)subchannel_list, - (unsigned long)(count + 1), (unsigned long)count); + (unsigned long)(count + 1), (unsigned long)count, reason); } if (done) { rr_subchannel_list_destroy(exec_ctx, subchannel_list); @@ -196,16 +196,10 @@ static void rr_subchannel_list_unref(grpc_exec_ctx *exec_ctx, static void rr_subchannel_list_shutdown(grpc_exec_ctx *exec_ctx, rr_subchannel_list *subchannel_list, const char *reason) { - if (subchannel_list->shutting_down) { - if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Subchannel list %p already shutting down", - (void *)subchannel_list); - } - return; - }; + GPR_ASSERT(!subchannel_list->shutting_down); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Shutting down subchannel_list %p", - (void *)subchannel_list); + gpr_log(GPR_DEBUG, "Shutting down subchannel_list %p (%s)", + (void *)subchannel_list, reason); } GPR_ASSERT(!subchannel_list->shutting_down); subchannel_list->shutting_down = true; @@ -317,9 +311,19 @@ static void rr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { grpc_connectivity_state_set( exec_ctx, &p->state_tracker, GRPC_CHANNEL_SHUTDOWN, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"), "rr_shutdown"); + const bool latest_is_current = + p->subchannel_list == p->latest_pending_subchannel_list; rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "sl_shutdown_rr_shutdown"); + rr_subchannel_list_unref(exec_ctx, p->subchannel_list, + "sl_unref_rr_shutdown"); + if (!latest_is_current && p->latest_pending_subchannel_list != NULL && + !p->latest_pending_subchannel_list->shutting_down) { + rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, + "sl_shutdown_pending_rr_shutdown"); + } p->subchannel_list = NULL; + p->latest_pending_subchannel_list = NULL; } static void rr_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, @@ -375,8 +379,8 @@ static void start_picking_locked(grpc_exec_ctx *exec_ctx, p->started_picking = true; for (size_t i = 0; i < p->subchannel_list->num_subchannels; i++) { subchannel_data *sd = &p->subchannel_list->subchannels[i]; - GRPC_LB_POLICY_WEAK_REF(&p->base, "rr_connectivity"); - rr_subchannel_list_ref(sd->subchannel_list, "start_picking"); + GRPC_LB_POLICY_WEAK_REF(&p->base, "start_picking_locked"); + rr_subchannel_list_ref(sd->subchannel_list, "start_picking_locked"); grpc_subchannel_notify_on_state_change( exec_ctx, sd->subchannel, p->base.interested_parties, &sd->pending_connectivity_state_unsafe, @@ -559,7 +563,10 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, if (sd->subchannel_list != p->subchannel_list && sd->subchannel_list != p->latest_pending_subchannel_list) { // sd belongs to an outdated subchannel_list: get rid of it. - rr_subchannel_list_shutdown(exec_ctx, sd->subchannel_list, "sl_oudated"); + rr_subchannel_list_shutdown(exec_ctx, sd->subchannel_list, "sl_outdated"); + rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, + "sl_outdated+unref"); + GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_outdated"); return; } // Now that we're inside the combiner, copy the pending connectivity @@ -618,9 +625,13 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, if (p->subchannel_list != NULL) { // dispose of the current subchannel_list rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "sl_shutdown_rr_update_connectivity"); + "sl_phase_out_shutdown"); + rr_subchannel_list_unref(exec_ctx, p->subchannel_list, + "sl_phase_out_shutdown+unref"); } - p->subchannel_list = sd->subchannel_list; + rr_subchannel_list_ref(p->latest_pending_subchannel_list, + "sl_promotion"); + p->subchannel_list = p->latest_pending_subchannel_list; p->latest_pending_subchannel_list = NULL; } /* at this point we know there's at least one suitable subchannel. Go @@ -731,7 +742,9 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, "rr_update_empty"); if (p->subchannel_list != NULL) { rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "sl_shutdown_rr_update"); + "sl_shutdown_empty_update"); + rr_subchannel_list_unref(exec_ctx, p->subchannel_list, + "sl_shutdown_empty_update+unref"); p->subchannel_list = NULL; } return; @@ -743,6 +756,17 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, gpr_zalloc(sizeof(subchannel_data) * num_addrs); subchannel_list->num_subchannels = num_addrs; gpr_ref_init(&subchannel_list->refcount, 1); + if (p->latest_pending_subchannel_list != NULL && p->started_picking) { + if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { + gpr_log(GPR_DEBUG, + "Shutting down latest pending subchannel list %p, about to be " + "replaced by newer latest %p", + (void *)p->latest_pending_subchannel_list, + (void *)subchannel_list); + } + rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, + "sl_outdated_dont_smash"); + } p->latest_pending_subchannel_list = subchannel_list; if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { gpr_log(GPR_DEBUG, "Created subchannel list %p for %lu subchannels", @@ -817,7 +841,9 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "rr_update_before_started_picking"); } + rr_subchannel_list_ref(subchannel_list, "sl_initial_promotion"); p->subchannel_list = subchannel_list; + p->latest_pending_subchannel_list = NULL; } } -- cgit v1.2.3 From 47e12924c5804e389ac9b5abed9eb27f74bb622e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 13 Jul 2017 13:25:17 -0700 Subject: PR comments --- .../lb_policy/round_robin/round_robin.c | 77 ++++++++++++++-------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c index dfd2b513b1..3e34257ea7 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c @@ -191,6 +191,21 @@ static void rr_subchannel_list_unref(grpc_exec_ctx *exec_ctx, } } +static rr_subchannel_list *rr_subchannel_list_create(round_robin_lb_policy *p, + size_t num_subchannels) { + rr_subchannel_list *subchannel_list = gpr_zalloc(sizeof(*subchannel_list)); + subchannel_list->policy = p; + subchannel_list->subchannels = + gpr_zalloc(sizeof(subchannel_data) * num_subchannels); + subchannel_list->num_subchannels = num_subchannels; + gpr_ref_init(&subchannel_list->refcount, 1); + if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { + gpr_log(GPR_DEBUG, "Created subchannel list %p for %lu subchannels", + (void *)subchannel_list, (unsigned long)num_subchannels); + } + return subchannel_list; +} + /** Mark \a subchannel_list as discarded. Unsubscribes all its subchannels. The * watcher's callback will ultimately unref \a subchannel_list. */ static void rr_subchannel_list_shutdown(grpc_exec_ctx *exec_ctx, @@ -217,7 +232,8 @@ static void rr_subchannel_list_shutdown(grpc_exec_ctx *exec_ctx, &sd->connectivity_changed_closure); } } - rr_subchannel_list_unref(exec_ctx, subchannel_list, reason); + // Corresponds to the creation ref. + rr_subchannel_list_unref(exec_ctx, subchannel_list, "creation"); } /** Returns the index into p->subchannel_list->subchannels of the next @@ -316,14 +332,16 @@ static void rr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "sl_shutdown_rr_shutdown"); rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_unref_rr_shutdown"); + "sl_shutdown_current+make_pending"); if (!latest_is_current && p->latest_pending_subchannel_list != NULL && !p->latest_pending_subchannel_list->shutting_down) { rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, "sl_shutdown_pending_rr_shutdown"); + rr_subchannel_list_unref(exec_ctx, p->latest_pending_subchannel_list, + "sl_shutdown_pending+make_pending"); + p->latest_pending_subchannel_list = NULL; } p->subchannel_list = NULL; - p->latest_pending_subchannel_list = NULL; } static void rr_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, @@ -380,7 +398,7 @@ static void start_picking_locked(grpc_exec_ctx *exec_ctx, for (size_t i = 0; i < p->subchannel_list->num_subchannels; i++) { subchannel_data *sd = &p->subchannel_list->subchannels[i]; GRPC_LB_POLICY_WEAK_REF(&p->base, "start_picking_locked"); - rr_subchannel_list_ref(sd->subchannel_list, "start_picking_locked"); + rr_subchannel_list_ref(sd->subchannel_list, "started_picking"); grpc_subchannel_notify_on_state_change( exec_ctx, sd->subchannel, p->base.interested_parties, &sd->pending_connectivity_state_unsafe, @@ -548,15 +566,18 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, } // If the policy is shutting down, unref and return. if (p->shutdown) { - rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, "pol_shutdown"); + rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, + "pol_shutdown+started_picking"); GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "pol_shutdown"); return; } if (sd->subchannel_list->shutting_down && error == GRPC_ERROR_CANCELLED) { // the subchannel list associated with sd has been discarded. This callback - // corresponds to the unsubscription. - rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, "sl_shutdown"); - GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_shutdown"); + // corresponds to the unsubscription. The unrefs correspond to the picking + // ref (start_picking_locked or update_started_picking). + rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, + "sl_shutdown+started_picking"); + GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_shutdown+picking"); return; } // Dispose of outdated subchannel lists. @@ -565,7 +586,7 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, // sd belongs to an outdated subchannel_list: get rid of it. rr_subchannel_list_shutdown(exec_ctx, sd->subchannel_list, "sl_outdated"); rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, - "sl_outdated+unref"); + "sl_outdated+started_picking"); GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_outdated"); return; } @@ -589,7 +610,7 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, sd->user_data = NULL; } if (new_policy_connectivity_state == GRPC_CHANNEL_SHUTDOWN) { - /* the policy is shutting down. Flush all the pending picks... */ + // the policy is shutting down. Flush all the pending picks... pending_pick *pp; while ((pp = p->pending_picks)) { p->pending_picks = pp->next; @@ -598,8 +619,9 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, gpr_free(pp); } } - /* unref the "rr_connectivity" weak ref from start_picking */ - rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, "sd_shutdown"); + rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, + "sd_shutdown+started_picking"); + // unref the "rr_connectivity_update" weak ref from start_picking. GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "rr_connectivity_sd_shutdown"); } else { // sd not in SHUTDOWN @@ -627,10 +649,11 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "sl_phase_out_shutdown"); rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_phase_out_shutdown+unref"); + "sl_phase_out_shutdown+started_picking"); } - rr_subchannel_list_ref(p->latest_pending_subchannel_list, - "sl_promotion"); + // Promote pending list: No need to take a ref on + // p->latest_pending_subchannel_list: reusing its "make_pending" + // one. p->subchannel_list = p->latest_pending_subchannel_list; p->latest_pending_subchannel_list = NULL; } @@ -665,8 +688,8 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, gpr_free(pp); } } - /* renew notification: reuses the "rr_connectivity" weak ref on the policy - * as well as the sd->subchannel_list ref. */ + /* renew notification: reuses the "rr_connectivity_update" weak ref on the + * policy as well as the sd->subchannel_list ref. */ grpc_subchannel_notify_on_state_change( exec_ctx, sd->subchannel, p->base.interested_parties, &sd->pending_connectivity_state_unsafe, @@ -744,18 +767,13 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "sl_shutdown_empty_update"); rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_shutdown_empty_update+unref"); + "sl_shutdown_empty_update+make_pending"); p->subchannel_list = NULL; } return; } size_t subchannel_index = 0; - rr_subchannel_list *subchannel_list = gpr_zalloc(sizeof(*subchannel_list)); - subchannel_list->policy = p; - subchannel_list->subchannels = - gpr_zalloc(sizeof(subchannel_data) * num_addrs); - subchannel_list->num_subchannels = num_addrs; - gpr_ref_init(&subchannel_list->refcount, 1); + rr_subchannel_list *subchannel_list = rr_subchannel_list_create(p, num_addrs); if (p->latest_pending_subchannel_list != NULL && p->started_picking) { if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { gpr_log(GPR_DEBUG, @@ -766,12 +784,11 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, } rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, "sl_outdated_dont_smash"); + rr_subchannel_list_unref(exec_ctx, p->latest_pending_subchannel_list, + "sl_outdated_dont_smash+make_pending"); } p->latest_pending_subchannel_list = subchannel_list; - if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Created subchannel list %p for %lu subchannels", - (void *)subchannel_list, (unsigned long)num_addrs); - } + rr_subchannel_list_ref(p->latest_pending_subchannel_list, "make_pending"); grpc_subchannel_args sc_args; /* We need to remove the LB addresses in order to be able to compare the * subchannel keys of subchannels from a different batch of addresses. */ @@ -840,8 +857,10 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, if (p->subchannel_list != NULL) { rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, "rr_update_before_started_picking"); + rr_subchannel_list_unref(exec_ctx, subchannel_list, + "rr_update_before_started_picking+make_pending"); } - rr_subchannel_list_ref(subchannel_list, "sl_initial_promotion"); + // Recycles "make_pending" reference. p->subchannel_list = subchannel_list; p->latest_pending_subchannel_list = NULL; } -- cgit v1.2.3 From 507d1fd58ec0ad6808d98089ecf257815e601261 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 13 Jul 2017 15:31:51 -0700 Subject: Removed duplicated refs --- .../lb_policy/round_robin/round_robin.c | 146 ++++++++++----------- 1 file changed, 67 insertions(+), 79 deletions(-) diff --git a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c index 3e34257ea7..def8d5d68a 100644 --- a/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c +++ b/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.c @@ -141,6 +141,21 @@ struct rr_subchannel_list { bool shutting_down; }; +static rr_subchannel_list *rr_subchannel_list_create(round_robin_lb_policy *p, + size_t num_subchannels) { + rr_subchannel_list *subchannel_list = gpr_zalloc(sizeof(*subchannel_list)); + subchannel_list->policy = p; + subchannel_list->subchannels = + gpr_zalloc(sizeof(subchannel_data) * num_subchannels); + subchannel_list->num_subchannels = num_subchannels; + gpr_ref_init(&subchannel_list->refcount, 1); + if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { + gpr_log(GPR_INFO, "[RR %p] Created subchannel list %p for %lu subchannels", + (void *)p, (void *)subchannel_list, (unsigned long)num_subchannels); + } + return subchannel_list; +} + static void rr_subchannel_list_destroy(grpc_exec_ctx *exec_ctx, rr_subchannel_list *subchannel_list) { GPR_ASSERT(subchannel_list->shutting_down); @@ -191,30 +206,15 @@ static void rr_subchannel_list_unref(grpc_exec_ctx *exec_ctx, } } -static rr_subchannel_list *rr_subchannel_list_create(round_robin_lb_policy *p, - size_t num_subchannels) { - rr_subchannel_list *subchannel_list = gpr_zalloc(sizeof(*subchannel_list)); - subchannel_list->policy = p; - subchannel_list->subchannels = - gpr_zalloc(sizeof(subchannel_data) * num_subchannels); - subchannel_list->num_subchannels = num_subchannels; - gpr_ref_init(&subchannel_list->refcount, 1); - if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Created subchannel list %p for %lu subchannels", - (void *)subchannel_list, (unsigned long)num_subchannels); - } - return subchannel_list; -} - /** Mark \a subchannel_list as discarded. Unsubscribes all its subchannels. The * watcher's callback will ultimately unref \a subchannel_list. */ -static void rr_subchannel_list_shutdown(grpc_exec_ctx *exec_ctx, - rr_subchannel_list *subchannel_list, - const char *reason) { +static void rr_subchannel_list_shutdown_and_unref( + grpc_exec_ctx *exec_ctx, rr_subchannel_list *subchannel_list, + const char *reason) { GPR_ASSERT(!subchannel_list->shutting_down); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Shutting down subchannel_list %p (%s)", - (void *)subchannel_list, reason); + gpr_log(GPR_DEBUG, "[RR %p] Shutting down subchannel_list %p (%s)", + (void *)subchannel_list->policy, (void *)subchannel_list, reason); } GPR_ASSERT(!subchannel_list->shutting_down); subchannel_list->shutting_down = true; @@ -222,18 +222,19 @@ static void rr_subchannel_list_shutdown(grpc_exec_ctx *exec_ctx, subchannel_data *sd = &subchannel_list->subchannels[i]; if (sd->subchannel != NULL) { // if subchannel isn't shutdown, unsubscribe. if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, - "Unsubscribing from subchannel %p as part of shutting down " - "subchannel_list %p", - (void *)sd->subchannel, (void *)subchannel_list); + gpr_log( + GPR_DEBUG, + "[RR %p] Unsubscribing from subchannel %p as part of shutting down " + "subchannel_list %p", + (void *)subchannel_list->policy, (void *)sd->subchannel, + (void *)subchannel_list); } grpc_subchannel_notify_on_state_change(exec_ctx, sd->subchannel, NULL, NULL, &sd->connectivity_changed_closure); } } - // Corresponds to the creation ref. - rr_subchannel_list_unref(exec_ctx, subchannel_list, "creation"); + rr_subchannel_list_unref(exec_ctx, subchannel_list, reason); } /** Returns the index into p->subchannel_list->subchannels of the next @@ -303,7 +304,8 @@ static void update_last_ready_subchannel_index_locked(round_robin_lb_policy *p, static void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Destroying Round Robin policy at %p", (void *)pol); + gpr_log(GPR_DEBUG, "[RR %p] Destroying Round Robin policy at %p", + (void *)pol, (void *)pol); } grpc_connectivity_state_destroy(exec_ctx, &p->state_tracker); gpr_free(p); @@ -312,7 +314,8 @@ static void rr_destroy(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { static void rr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Shutting down Round Robin policy at %p", (void *)pol); + gpr_log(GPR_DEBUG, "[RR %p] Shutting down Round Robin policy at %p", + (void *)pol, (void *)pol); } p->shutdown = true; pending_pick *pp; @@ -329,19 +332,16 @@ static void rr_shutdown_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol) { GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel Shutdown"), "rr_shutdown"); const bool latest_is_current = p->subchannel_list == p->latest_pending_subchannel_list; - rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "sl_shutdown_rr_shutdown"); - rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_shutdown_current+make_pending"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list, + "sl_shutdown_rr_shutdown"); + p->subchannel_list = NULL; if (!latest_is_current && p->latest_pending_subchannel_list != NULL && !p->latest_pending_subchannel_list->shutting_down) { - rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, - "sl_shutdown_pending_rr_shutdown"); - rr_subchannel_list_unref(exec_ctx, p->latest_pending_subchannel_list, - "sl_shutdown_pending+make_pending"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, + p->latest_pending_subchannel_list, + "sl_shutdown_pending_rr_shutdown"); p->latest_pending_subchannel_list = NULL; } - p->subchannel_list = NULL; } static void rr_cancel_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, @@ -420,7 +420,7 @@ static int rr_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, grpc_closure *on_complete) { round_robin_lb_policy *p = (round_robin_lb_policy *)pol; if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_INFO, "Round Robin %p trying to pick", (void *)pol); + gpr_log(GPR_INFO, "[RR %p] Trying to pick", (void *)pol); } if (p->subchannel_list != NULL) { const size_t next_ready_index = get_next_ready_subchannel_index_locked(p); @@ -436,8 +436,8 @@ static int rr_pick_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *pol, if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { gpr_log( GPR_DEBUG, - "[RR %p] PICKED TARGET <-- SUBCHANNEL %p (CONNECTED %p) (SL %p, " - "INDEX %lu)", + "[RR %p] Picked target <-- Subchannel %p (connected %p) (sl %p, " + "index %lu)", (void *)p, (void *)sd->subchannel, (void *)*target, (void *)sd->subchannel_list, (unsigned long)next_ready_index); } @@ -584,9 +584,8 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, if (sd->subchannel_list != p->subchannel_list && sd->subchannel_list != p->latest_pending_subchannel_list) { // sd belongs to an outdated subchannel_list: get rid of it. - rr_subchannel_list_shutdown(exec_ctx, sd->subchannel_list, "sl_outdated"); - rr_subchannel_list_unref(exec_ctx, sd->subchannel_list, - "sl_outdated+started_picking"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, sd->subchannel_list, + "sl_outdated"); GRPC_LB_POLICY_WEAK_UNREF(exec_ctx, &p->base, "sl_outdated"); return; } @@ -646,14 +645,9 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, } if (p->subchannel_list != NULL) { // dispose of the current subchannel_list - rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "sl_phase_out_shutdown"); - rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_phase_out_shutdown+started_picking"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list, + "sl_phase_out_shutdown"); } - // Promote pending list: No need to take a ref on - // p->latest_pending_subchannel_list: reusing its "make_pending" - // one. p->subchannel_list = p->latest_pending_subchannel_list; p->latest_pending_subchannel_list = NULL; } @@ -665,8 +659,8 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, subchannel_data *selected = &p->subchannel_list->subchannels[next_ready_index]; if (p->pending_picks != NULL) { - /* if the selected subchannel is going to be used for the pending - * picks, update the last picked pointer */ + // if the selected subchannel is going to be used for the pending + // picks, update the last picked pointer update_last_ready_subchannel_index_locked(p, next_ready_index); } pending_pick *pp; @@ -680,9 +674,10 @@ static void rr_connectivity_changed_locked(grpc_exec_ctx *exec_ctx, void *arg, } if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { gpr_log(GPR_DEBUG, - "[RR CONN CHANGED] TARGET <-- SUBCHANNEL %p (INDEX %lu)", - (void *)selected->subchannel, - (unsigned long)next_ready_index); + "[RR %p] Fulfilling pending pick. Target <-- subchannel %p " + "(subchannel_list %p, index %lu)", + (void *)p, (void *)selected->subchannel, + (void *)p->subchannel_list, (unsigned long)next_ready_index); } GRPC_CLOSURE_SCHED(exec_ctx, pp->on_complete, GRPC_ERROR_NONE); gpr_free(pp); @@ -747,8 +742,7 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, } else { // otherwise, keep using the current subchannel list (ignore this update). gpr_log(GPR_ERROR, - "No valid LB addresses channel arg for Round Robin %p update, " - "ignoring.", + "[RR %p] No valid LB addresses channel arg for update, ignoring.", (void *)p); } return; @@ -764,10 +758,8 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Empty update"), "rr_update_empty"); if (p->subchannel_list != NULL) { - rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "sl_shutdown_empty_update"); - rr_subchannel_list_unref(exec_ctx, p->subchannel_list, - "sl_shutdown_empty_update+make_pending"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list, + "sl_shutdown_empty_update"); p->subchannel_list = NULL; } return; @@ -777,18 +769,16 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, if (p->latest_pending_subchannel_list != NULL && p->started_picking) { if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { gpr_log(GPR_DEBUG, - "Shutting down latest pending subchannel list %p, about to be " + "[RR %p] Shutting down latest pending subchannel list %p, about " + "to be " "replaced by newer latest %p", - (void *)p->latest_pending_subchannel_list, + (void *)p, (void *)p->latest_pending_subchannel_list, (void *)subchannel_list); } - rr_subchannel_list_shutdown(exec_ctx, p->latest_pending_subchannel_list, - "sl_outdated_dont_smash"); - rr_subchannel_list_unref(exec_ctx, p->latest_pending_subchannel_list, - "sl_outdated_dont_smash+make_pending"); + rr_subchannel_list_shutdown_and_unref( + exec_ctx, p->latest_pending_subchannel_list, "sl_outdated_dont_smash"); } p->latest_pending_subchannel_list = subchannel_list; - rr_subchannel_list_ref(p->latest_pending_subchannel_list, "make_pending"); grpc_subchannel_args sc_args; /* We need to remove the LB addresses in order to be able to compare the * subchannel keys of subchannels from a different batch of addresses. */ @@ -812,11 +802,12 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { char *address_uri = grpc_sockaddr_to_uri(&addresses->addresses[i].address); - gpr_log(GPR_DEBUG, - "index %lu: Created subchannel %p for address uri %s into " - "subchannel_list %p", - (unsigned long)subchannel_index, (void *)subchannel, address_uri, - (void *)subchannel_list); + gpr_log( + GPR_DEBUG, + "[RR %p] index %lu: Created subchannel %p for address uri %s into " + "subchannel_list %p", + (void *)p, (unsigned long)subchannel_index, (void *)subchannel, + address_uri, (void *)subchannel_list); gpr_free(address_uri); } grpc_channel_args_destroy(exec_ctx, new_args); @@ -855,12 +846,9 @@ static void rr_update_locked(grpc_exec_ctx *exec_ctx, grpc_lb_policy *policy, // The policy isn't picking yet. Save the update for later, disposing of // previous version if any. if (p->subchannel_list != NULL) { - rr_subchannel_list_shutdown(exec_ctx, p->subchannel_list, - "rr_update_before_started_picking"); - rr_subchannel_list_unref(exec_ctx, subchannel_list, - "rr_update_before_started_picking+make_pending"); + rr_subchannel_list_shutdown_and_unref(exec_ctx, p->subchannel_list, + "rr_update_before_started_picking"); } - // Recycles "make_pending" reference. p->subchannel_list = subchannel_list; p->latest_pending_subchannel_list = NULL; } @@ -892,7 +880,7 @@ static grpc_lb_policy *round_robin_create(grpc_exec_ctx *exec_ctx, grpc_connectivity_state_init(&p->state_tracker, GRPC_CHANNEL_IDLE, "round_robin"); if (GRPC_TRACER_ON(grpc_lb_round_robin_trace)) { - gpr_log(GPR_DEBUG, "Created Round Robin %p with %lu subchannels", (void *)p, + gpr_log(GPR_DEBUG, "[RR %p] Created with %lu subchannels", (void *)p, (unsigned long)p->subchannel_list->num_subchannels); } return &p->base; -- cgit v1.2.3 From b03e5cbb0f4cc1226167a1900ed83f9ff44e770e Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 13 Jul 2017 16:09:22 -0700 Subject: Add @mehrdada to python OWNERS --- src/python/OWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/OWNERS b/src/python/OWNERS index 73a707c67d..436432916b 100644 --- a/src/python/OWNERS +++ b/src/python/OWNERS @@ -1,3 +1,3 @@ @nathanielmanistaatgoogle @kpayson64 - +@mehrdada -- cgit v1.2.3 From e6fb12fd96cac6c3607e23bdaf079048fc0e538d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 13 Jul 2017 16:10:39 -0700 Subject: Add additional OWNERS files for Python projects --- examples/python/OWNERS | 3 +++ tools/distrib/python/OWNERS | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 examples/python/OWNERS create mode 100644 tools/distrib/python/OWNERS diff --git a/examples/python/OWNERS b/examples/python/OWNERS new file mode 100644 index 0000000000..436432916b --- /dev/null +++ b/examples/python/OWNERS @@ -0,0 +1,3 @@ +@nathanielmanistaatgoogle +@kpayson64 +@mehrdada diff --git a/tools/distrib/python/OWNERS b/tools/distrib/python/OWNERS new file mode 100644 index 0000000000..436432916b --- /dev/null +++ b/tools/distrib/python/OWNERS @@ -0,0 +1,3 @@ +@nathanielmanistaatgoogle +@kpayson64 +@mehrdada -- cgit v1.2.3 From 9a4ed686b1a0a0f3b655a34e61151b1dcb0db744 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 13 Jul 2017 16:12:30 -0700 Subject: Improved testing --- src/core/ext/filters/client_channel/subchannel_index.c | 7 +++++++ src/core/ext/filters/client_channel/subchannel_index.h | 12 ++++++++++++ test/cpp/end2end/client_lb_end2end_test.cc | 13 +++++++++---- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/core/ext/filters/client_channel/subchannel_index.c b/src/core/ext/filters/client_channel/subchannel_index.c index e291ca9db9..a33ab950bf 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.c +++ b/src/core/ext/filters/client_channel/subchannel_index.c @@ -40,6 +40,8 @@ struct grpc_subchannel_key { GPR_TLS_DECL(subchannel_index_exec_ctx); +static bool g_force_creation = false; + static void enter_ctx(grpc_exec_ctx *exec_ctx) { GPR_ASSERT(gpr_tls_get(&subchannel_index_exec_ctx) == 0); gpr_tls_set(&subchannel_index_exec_ctx, (intptr_t)exec_ctx); @@ -84,6 +86,7 @@ static grpc_subchannel_key *subchannel_key_copy(grpc_subchannel_key *k) { int grpc_subchannel_key_compare(const grpc_subchannel_key *a, const grpc_subchannel_key *b) { + if (g_force_creation) return false; int c = GPR_ICMP(a->args.filter_count, b->args.filter_count); if (c != 0) return c; if (a->args.filter_count > 0) { @@ -250,3 +253,7 @@ void grpc_subchannel_index_unregister(grpc_exec_ctx *exec_ctx, leave_ctx(exec_ctx); } + +void grpc_subchannel_index_test_only_set_force_creation(bool force_creation) { + g_force_creation = force_creation; +} diff --git a/src/core/ext/filters/client_channel/subchannel_index.h b/src/core/ext/filters/client_channel/subchannel_index.h index e303bfaa05..98d882a453 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.h +++ b/src/core/ext/filters/client_channel/subchannel_index.h @@ -59,4 +59,16 @@ void grpc_subchannel_index_init(void); /** Shutdown the subchannel index (global) */ void grpc_subchannel_index_shutdown(void); +/** \em TEST ONLY. + * If \a force_creation is true, all key comparisons will be false, resulting in + * new subchannels always being created. Otherwise, the keys will be compared as + * usual. + * + * This function is *not* threadsafe on purpose: it should *only* be used in + * test code. + * + * Tests using this function \em MUST run tests with and without \a + * force_creation set. */ +void grpc_subchannel_index_test_only_set_force_creation(bool force_creation); + #endif /* GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_SUBCHANNEL_INDEX_H */ diff --git a/test/cpp/end2end/client_lb_end2end_test.cc b/test/cpp/end2end/client_lb_end2end_test.cc index 6d3f5a9d46..e1160ecdc6 100644 --- a/test/cpp/end2end/client_lb_end2end_test.cc +++ b/test/cpp/end2end/client_lb_end2end_test.cc @@ -35,6 +35,7 @@ extern "C" { #include "src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h" +#include "src/core/ext/filters/client_channel/subchannel_index.h" } #include "src/proto/grpc/testing/echo.grpc.pb.h" @@ -331,10 +332,14 @@ TEST_F(ClientLbEnd2endTest, PickFirstManyUpdates) { for (size_t i = 0; i < servers_.size(); ++i) { ports.emplace_back(servers_[i]->port_); } - for (size_t i = 0; i < 1000; ++i) { - std::random_shuffle(ports.begin(), ports.end()); - SetNextResolution(ports); - if (i % 10 == 0) SendRpc(); + for (const bool force_creation : {true, false}) { + grpc_subchannel_index_test_only_set_force_creation(force_creation); + gpr_log(GPR_INFO, "Force subchannel creation: %d", force_creation); + for (size_t i = 0; i < 1000; ++i) { + std::random_shuffle(ports.begin(), ports.end()); + SetNextResolution(ports); + if (i % 10 == 0) SendRpc(); + } } // Check LB policy name for the channel. EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName()); -- cgit v1.2.3 From 41690d1ad8e26b89c13558d701f6310df80ee9ca Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 13 Jul 2017 16:16:13 -0700 Subject: Detach ownership of core/c++ --- .github/CODEOWNERS | 14 +++++++------- src/core/OWNERS | 1 + src/cpp/OWNERS | 1 + test/core/OWNERS | 1 + test/cpp/OWNERS | 1 + 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 73c3609aa0..32bc89e6f6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -14,10 +14,10 @@ /etc/** @jboeuf @nicolasnoble @a11r @ctiller /examples/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /include/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/src/core/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/src/core/lib/iomgr/*_uv.c @murgatroid99 @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/src/core/lib/iomgr/*_uv.h @murgatroid99 @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/src/cpp/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble +/src/core/** @ctiller @markdroth @dgquintas +/src/core/lib/iomgr/*_uv.c @murgatroid99 @ctiller @markdroth @dgquintas +/src/core/lib/iomgr/*_uv.h @murgatroid99 @ctiller @markdroth @dgquintas +/src/cpp/** @ctiller @markdroth @dgquintas /src/csharp/** @jtattermusch @apolcyn @a11r @nicolasnoble @ctiller /src/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /src/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller @@ -25,9 +25,9 @@ /src/python/** @nathanielmanistaatgoogle @kpayson64 @a11r @nicolasnoble @ctiller /src/ruby/** @apolcyn @murgatroid99 @a11r @nicolasnoble @ctiller /test/build/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/test/core/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/test/cpp/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble -/test/cpp/qps/** @vjpai @ctiller @markdroth @dgquintas @a11r @nicolasnoble +/test/core/** @ctiller @markdroth @dgquintas +/test/cpp/** @ctiller @markdroth @dgquintas +/test/cpp/qps/** @vjpai @ctiller @markdroth @dgquintas /test/distrib/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /tools/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/codegen/core/** @ctiller @dgquintas @markdroth diff --git a/src/core/OWNERS b/src/core/OWNERS index 8dca75ce91..986c9a1c3c 100644 --- a/src/core/OWNERS +++ b/src/core/OWNERS @@ -1,3 +1,4 @@ +set noparent @ctiller @markdroth @dgquintas diff --git a/src/cpp/OWNERS b/src/cpp/OWNERS index 8dca75ce91..986c9a1c3c 100644 --- a/src/cpp/OWNERS +++ b/src/cpp/OWNERS @@ -1,3 +1,4 @@ +set noparent @ctiller @markdroth @dgquintas diff --git a/test/core/OWNERS b/test/core/OWNERS index 8dca75ce91..986c9a1c3c 100644 --- a/test/core/OWNERS +++ b/test/core/OWNERS @@ -1,3 +1,4 @@ +set noparent @ctiller @markdroth @dgquintas diff --git a/test/cpp/OWNERS b/test/cpp/OWNERS index 8dca75ce91..986c9a1c3c 100644 --- a/test/cpp/OWNERS +++ b/test/cpp/OWNERS @@ -1,3 +1,4 @@ +set noparent @ctiller @markdroth @dgquintas -- cgit v1.2.3 From 76a316cb1f83cf11657410f1ba75e9f3586aa49d Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 13 Jul 2017 16:18:58 -0700 Subject: Add `set noparent` to Python OWNER files --- examples/python/OWNERS | 2 ++ src/python/OWNERS | 2 ++ tools/distrib/python/OWNERS | 2 ++ 3 files changed, 6 insertions(+) diff --git a/examples/python/OWNERS b/examples/python/OWNERS index 436432916b..ea3909e0a3 100644 --- a/examples/python/OWNERS +++ b/examples/python/OWNERS @@ -1,3 +1,5 @@ +set noparent + @nathanielmanistaatgoogle @kpayson64 @mehrdada diff --git a/src/python/OWNERS b/src/python/OWNERS index 436432916b..ea3909e0a3 100644 --- a/src/python/OWNERS +++ b/src/python/OWNERS @@ -1,3 +1,5 @@ +set noparent + @nathanielmanistaatgoogle @kpayson64 @mehrdada diff --git a/tools/distrib/python/OWNERS b/tools/distrib/python/OWNERS index 436432916b..ea3909e0a3 100644 --- a/tools/distrib/python/OWNERS +++ b/tools/distrib/python/OWNERS @@ -1,3 +1,5 @@ +set noparent + @nathanielmanistaatgoogle @kpayson64 @mehrdada -- cgit v1.2.3 From f20a345ca5c1ffe6969fdffcee51df77aa8ad081 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Thu, 13 Jul 2017 16:19:47 -0700 Subject: Regenerate CODEOWNERS --- .github/CODEOWNERS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 953e0a4aad..e2fa6faa8f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,6 +13,7 @@ /doc/interop-test-descriptions.md @ejona86 @a11r @nicolasnoble @ctiller /etc/** @jboeuf @nicolasnoble @a11r @ctiller /examples/node/** @murgatroid99 @a11r @nicolasnoble @ctiller +/examples/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /include/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble /src/core/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble /src/core/lib/iomgr/*_uv.c @murgatroid99 @ctiller @markdroth @dgquintas @a11r @nicolasnoble @@ -22,7 +23,7 @@ /src/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /src/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller /src/php/** @stanley-cheung @murgatroid99 @a11r @nicolasnoble @ctiller -/src/python/** @nathanielmanistaatgoogle @kpayson64 @a11r @nicolasnoble @ctiller +/src/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /src/ruby/** @apolcyn @murgatroid99 @a11r @nicolasnoble @ctiller /test/build/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble /test/core/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble @@ -30,6 +31,7 @@ /test/distrib/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /tools/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/codegen/core/** @ctiller @dgquintas @markdroth +/tools/distrib/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /tools/dockerfile/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/run_tests/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/run_tests/artifacts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller -- cgit v1.2.3 From 51d0ff0f3da604dceac413b892e349ffd78f9237 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 10 Jul 2017 00:46:22 -0700 Subject: Fix deadlocks in grpclb_end2end_test --- test/cpp/end2end/grpclb_end2end_test.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/test/cpp/end2end/grpclb_end2end_test.cc b/test/cpp/end2end/grpclb_end2end_test.cc index 4f839f7788..74ded73ea6 100644 --- a/test/cpp/end2end/grpclb_end2end_test.cc +++ b/test/cpp/end2end/grpclb_end2end_test.cc @@ -194,12 +194,13 @@ class BalancerServiceImpl : public BalancerService { for (const auto& response_and_delay : responses_and_delays) { { std::unique_lock lock(mu_); - if (shutdown_) break; + if (shutdown_) goto done; } SendResponse(stream, response_and_delay.first, response_and_delay.second); } { std::unique_lock lock(mu_); + if (shutdown_) goto done; serverlist_cond_.wait(lock); } @@ -209,6 +210,9 @@ class BalancerServiceImpl : public BalancerService { gpr_log(GPR_INFO, "LB: recv client load report msg: '%s'", request.DebugString().c_str()); GPR_ASSERT(request.has_client_stats()); + // We need to acquire the lock here in order to prevent the notify_one + // below from firing before its corresponding wait is executed. + std::lock_guard lock(mu_); client_stats_.num_calls_started += request.client_stats().num_calls_started(); client_stats_.num_calls_finished += @@ -224,10 +228,9 @@ class BalancerServiceImpl : public BalancerService { .num_calls_finished_with_client_failed_to_send(); client_stats_.num_calls_finished_known_received += request.client_stats().num_calls_finished_known_received(); - std::lock_guard lock(mu_); load_report_cond_.notify_one(); } - + done: gpr_log(GPR_INFO, "LB: done"); return Status::OK; } @@ -428,19 +431,24 @@ class GrpclbEnd2endTest : public ::testing::Test { explicit ServerThread(const grpc::string& type, const grpc::string& server_host, T* service) : type_(type), service_(service) { + std::mutex mu; + // We need to acquire the lock here in order to prevent the notify_one + // by ServerThread::Start from firing before the wait below is hit. + std::unique_lock lock(mu); port_ = grpc_pick_unused_port_or_die(); gpr_log(GPR_INFO, "starting %s server on port %d", type_.c_str(), port_); - std::mutex mu; std::condition_variable cond; thread_.reset(new std::thread( std::bind(&ServerThread::Start, this, server_host, &mu, &cond))); - std::unique_lock lock(mu); cond.wait(lock); gpr_log(GPR_INFO, "%s server startup complete", type_.c_str()); } void Start(const grpc::string& server_host, std::mutex* mu, std::condition_variable* cond) { + // We need to acquire the lock here in order to prevent the notify_one + // below from firing before its corresponding wait is executed. + std::lock_guard lock(*mu); std::ostringstream server_address; server_address << server_host << ":" << port_; ServerBuilder builder; @@ -448,13 +456,12 @@ class GrpclbEnd2endTest : public ::testing::Test { InsecureServerCredentials()); builder.RegisterService(service_); server_ = builder.BuildAndStart(); - std::lock_guard lock(*mu); cond->notify_one(); } void Shutdown() { gpr_log(GPR_INFO, "%s about to shutdown", type_.c_str()); - server_->Shutdown(); + server_->Shutdown(grpc_timeout_milliseconds_to_deadline(0)); thread_->join(); gpr_log(GPR_INFO, "%s shutdown completed", type_.c_str()); } @@ -820,6 +827,7 @@ TEST_F(UpdatesTest, UpdateBalancersDeadUpdate) { // Kill balancer 0 gpr_log(GPR_INFO, "********** ABOUT TO KILL BALANCER 0 *************"); + balancers_[0]->NotifyDoneWithServerlists(); if (balancers_[0]->Shutdown()) balancer_servers_[0].Shutdown(); gpr_log(GPR_INFO, "********** KILLED BALANCER 0 *************"); -- cgit v1.2.3 From fc94d1f4a06c34cf637f48c9d1c6efab09e6a52b Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 13 Jul 2017 20:56:13 -0700 Subject: Fix use-after-free in timer manager --- src/core/lib/iomgr/timer_manager.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/lib/iomgr/timer_manager.c b/src/core/lib/iomgr/timer_manager.c index b9bea9a2ab..631f7935d9 100644 --- a/src/core/lib/iomgr/timer_manager.c +++ b/src/core/lib/iomgr/timer_manager.c @@ -84,7 +84,14 @@ static void start_timer_thread_and_unlock(void) { gpr_thd_options opt = gpr_thd_options_default(); gpr_thd_options_set_joinable(&opt); completed_thread *ct = gpr_malloc(sizeof(*ct)); + // The call to gpr_thd_new() has to be under the same lock used by + // gc_completed_threads(), particularly due to ct->t, which is written here + // (internally by gpr_thd_new) and read there. Otherwise it's possible for ct + // to leak through g_completed_threads and be freed in gc_completed_threads() + // before "&ct->t" is written to, causing a use-after-free. + gpr_mu_lock(&g_mu); gpr_thd_new(&ct->t, timer_thread, ct, &opt); + gpr_mu_unlock(&g_mu); } void grpc_timer_manager_tick() { -- cgit v1.2.3 From 46569f238c977bceaa89ce5d7af06d548da0eae6 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 14 Jul 2017 17:41:47 +0200 Subject: Adding a few owners for /src/python/grpcio/grpc_core_dependencies.py --- .github/CODEOWNERS | 1 + src/python/grpcio/OWNERS | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 src/python/grpcio/OWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 663a6ffb69..66f201c955 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -24,6 +24,7 @@ /src/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller /src/php/** @stanley-cheung @murgatroid99 @a11r @nicolasnoble @ctiller /src/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada +/src/python/grpcio/grpc_core_dependencies.py @a11y @ctiller @nicolasnoble @nathanielmanistaatgoogle @kpayson64 @mehrdada /src/ruby/** @apolcyn @murgatroid99 @a11r @nicolasnoble @ctiller /test/build/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble /test/core/** @ctiller @markdroth @dgquintas diff --git a/src/python/grpcio/OWNERS b/src/python/grpcio/OWNERS new file mode 100644 index 0000000000..78d54ec96b --- /dev/null +++ b/src/python/grpcio/OWNERS @@ -0,0 +1,3 @@ +@a11y grpc_core_dependencies.py +@ctiller grpc_core_dependencies.py +@nicolasnoble grpc_core_dependencies.py -- cgit v1.2.3 From a69878a2172e1514e9411a1e0d275f7870b80b6b Mon Sep 17 00:00:00 2001 From: Sree Kuchibhotla Date: Fri, 14 Jul 2017 11:25:14 -0700 Subject: fix memory leaks due to not calling grpc_shutdown in bm_cq_multiple_threads --- src/core/lib/iomgr/ev_posix.c | 4 ++++ src/core/lib/iomgr/ev_posix.h | 4 +++- test/cpp/microbenchmarks/bm_cq_multiple_threads.cc | 12 +++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/core/lib/iomgr/ev_posix.c b/src/core/lib/iomgr/ev_posix.c index a5ae04cb5b..cff77e641c 100644 --- a/src/core/lib/iomgr/ev_posix.c +++ b/src/core/lib/iomgr/ev_posix.c @@ -121,6 +121,10 @@ void grpc_set_event_engine_test_only( g_event_engine = ev_engine; } +const grpc_event_engine_vtable *grpc_get_event_engine_test_only() { + return g_event_engine; +} + /* Call this only after calling grpc_event_engine_init() */ const char *grpc_get_poll_strategy_name() { return g_poll_strategy_name; } diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h index 54c4f2ee11..0de7333843 100644 --- a/src/core/lib/iomgr/ev_posix.h +++ b/src/core/lib/iomgr/ev_posix.h @@ -153,7 +153,9 @@ void grpc_pollset_set_del_fd(grpc_exec_ctx *exec_ctx, typedef int (*grpc_poll_function_type)(struct pollfd *, nfds_t, int); extern grpc_poll_function_type grpc_poll_function; -/* This should be used for testing purposes ONLY */ +/* WARNING: The following two functions should be used for testing purposes + * ONLY */ void grpc_set_event_engine_test_only(const grpc_event_engine_vtable *); +const grpc_event_engine_vtable *grpc_get_event_engine_test_only(); #endif /* GRPC_CORE_LIB_IOMGR_EV_POSIX_H */ diff --git a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc index 1e3830a556..f79db15a47 100644 --- a/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc +++ b/test/cpp/microbenchmarks/bm_cq_multiple_threads.cc @@ -41,6 +41,7 @@ namespace testing { static void* g_tag = (void*)(intptr_t)10; // Some random number static grpc_completion_queue* g_cq; static grpc_event_engine_vtable g_vtable; +static const grpc_event_engine_vtable* g_old_vtable; static void pollset_shutdown(grpc_exec_ctx* exec_ctx, grpc_pollset* ps, grpc_closure* closure) { @@ -72,7 +73,7 @@ static grpc_error* pollset_work(grpc_exec_ctx* exec_ctx, grpc_pollset* ps, grpc_pollset_worker** worker, gpr_timespec now, gpr_timespec deadline) { if (gpr_time_cmp(deadline, gpr_time_0(GPR_CLOCK_MONOTONIC)) == 0) { - gpr_log(GPR_ERROR, "no-op"); + gpr_log(GPR_DEBUG, "no-op"); return GRPC_ERROR_NONE; } @@ -98,7 +99,12 @@ static void init_engine_vtable() { static void setup() { grpc_init(); + + /* Override the event engine with our test event engine (g_vtable); but before + * that, save the current event engine in g_old_vtable. We will have to set + * g_old_vtable back before calling grpc_shutdown() */ init_engine_vtable(); + g_old_vtable = grpc_get_event_engine_test_only(); grpc_set_event_engine_test_only(&g_vtable); g_cq = grpc_completion_queue_create_for_next(NULL); @@ -115,6 +121,10 @@ static void teardown() { } grpc_completion_queue_destroy(g_cq); + + /* Restore the old event engine before calling grpc_shutdown */ + grpc_set_event_engine_test_only(g_old_vtable); + grpc_shutdown(); } /* A few notes about Multi-threaded benchmarks: -- cgit v1.2.3 From 7976bdd09b9077d9692a6e952fa54afb90274ce0 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 14 Jul 2017 11:30:14 -0700 Subject: Change from intersection to supersets for glob comparisons This has the disadvantage that we can only use the current tree to collect evidence of overlap -- this means that it's possible for file addition or deletion to force a CODEOWNERS update. HOWEVER, it has the advantage that it's correct and propagates ownership in the way that we want (alleviating murgatroid@ from having to approve every additional file in the repository) --- .github/CODEOWNERS | 10 +++--- tools/mkowners/mkowners.py | 85 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 65 insertions(+), 30 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 32bc89e6f6..1cdf5f929b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,11 +2,11 @@ # Uses OWNERS files in different modules throughout the # repository as the source of truth for module ownership. /** @a11r @nicolasnoble @ctiller -/binding.gyp @murgatroid99 -/Gemfile @murgatroid99 -/grpc.gemspec @murgatroid99 -/package.json @murgatroid99 -/Rakefile @murgatroid99 +/binding.gyp @murgatroid99 @a11r @nicolasnoble @ctiller +/Gemfile @murgatroid99 @a11r @nicolasnoble @ctiller +/grpc.gemspec @murgatroid99 @a11r @nicolasnoble @ctiller +/package.json @murgatroid99 @a11r @nicolasnoble @ctiller +/Rakefile @murgatroid99 @a11r @nicolasnoble @ctiller /bazel/** @nicolasnoble @dgquintas @ctiller /cmake/** @jtattermusch @a11r @nicolasnoble @ctiller /doc/PROTOCOL-HTTP2.md @ejona86 @a11r @nicolasnoble @ctiller diff --git a/tools/mkowners/mkowners.py b/tools/mkowners/mkowners.py index 18afe3a2f0..1e39fb5a1f 100755 --- a/tools/mkowners/mkowners.py +++ b/tools/mkowners/mkowners.py @@ -126,30 +126,70 @@ owners_data = new_owners_data def full_dir(rules_dir, sub_path): return os.path.join(rules_dir, sub_path) if rules_dir != '.' else sub_path -def glob_intersect(g1, g2): - if not g2: - return all(c == '*' for c in g1) - if not g1: - return all(c == '*' for c in g2) - c1, *t1 = g1 - c2, *t2 = g2 - if c1 == '*': - return glob_intersect(g1, t2) or glob_intersect(t1, g2) - if c2 == '*': - return glob_intersect(t1, g2) or glob_intersect(g1, t2) - return c1 == c2 and glob_intersect(t1, t2) +# glob using git +gg_cache = {} +def git_glob(glob): + global gg_cache + if glob in gg_cache: return gg_cache[glob] + r = set(subprocess + .check_output(['git', 'ls-files', glob]) + .decode('utf-8') + .strip() + .splitlines()) + gg_cache[glob] = r + return r + +def expand_directives(root, directives): + globs = collections.OrderedDict() + # build a table of glob --> owners + for directive in directives: + for glob in directive.globs or ['**']: + if glob not in globs: + globs[glob] = [] + if directive.who not in globs[glob]: + globs[glob].append(directive.who) + # expand owners for intersecting globs + sorted_globs = sorted(globs.keys(), + key=lambda g: len(git_glob(os.path.join(root, g))), + reverse=True) + print('sorted_globs: ', sorted_globs) + out_globs = collections.OrderedDict() + for glob_add in sorted_globs: + who_add = globs[glob_add] + print('add: ', glob_add, who_add) + pre_items = [i for i in out_globs.items()] + out_globs[glob_add] = who_add.copy() + for glob_have, who_have in pre_items: + files_add = git_glob(full_dir(root, glob_add)) + files_have = git_glob(full_dir(root, glob_have)) + intersect = files_have.intersection(files_add) + if intersect: + for f in files_add: + if f not in intersect: + out_globs[os.path.relpath(root, f)] = who_add + for who in who_have: + if who not in out_globs[glob_add]: + out_globs[glob_add].append(who) + return out_globs def add_parent_to_globs(parent, globs, globs_dir): if not parent: return for owners in owners_data: if owners.dir == parent: - for directive in owners.directives: - for dglob in directive.globs or ['**']: - for gglob, glob in globs.items(): - if glob_intersect(full_dir(globs_dir, gglob), - full_dir(owners.dir, dglob)): - if directive.who not in glob: - glob.append(directive.who) + owners_globs = expand_directives(owners.dir, owners.directives) + for oglob, oglob_who in owners_globs.items(): + for gglob, gglob_who in globs.items(): + files_parent = git_glob(full_dir(owners.dir, oglob)) + files_child = git_glob(full_dir(globs_dir, gglob)) + intersect = files_parent.intersection(files_child) + gglob_who_orig = gglob_who.copy() + if intersect: + for f in files_child: + if f not in intersect: + globs[f] = gglob_who_orig.copy() + for who in oglob_who: + if who not in gglob_who: + gglob_who.append(who) add_parent_to_globs(owners.parent, globs, globs_dir) return assert(False) @@ -165,12 +205,7 @@ with open(args.out, 'w') as out: if head.parent and not head.parent in done: todo.append(head) continue - globs = collections.OrderedDict() - for directive in head.directives: - for glob in directive.globs or ['**']: - if glob not in globs: - globs[glob] = [] - globs[glob].append(directive.who) + globs = expand_directives(head.dir, head.directives) add_parent_to_globs(head.parent, globs, head.dir) for glob, owners in globs.items(): out.write('/%s %s\n' % ( -- cgit v1.2.3 From 92a85558bc807a8422c784b1850d3032823fa263 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 14 Jul 2017 11:36:09 -0700 Subject: Fix argument ordering --- tools/mkowners/mkowners.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/mkowners/mkowners.py b/tools/mkowners/mkowners.py index 1e39fb5a1f..4805df45df 100755 --- a/tools/mkowners/mkowners.py +++ b/tools/mkowners/mkowners.py @@ -152,11 +152,9 @@ def expand_directives(root, directives): sorted_globs = sorted(globs.keys(), key=lambda g: len(git_glob(os.path.join(root, g))), reverse=True) - print('sorted_globs: ', sorted_globs) out_globs = collections.OrderedDict() for glob_add in sorted_globs: who_add = globs[glob_add] - print('add: ', glob_add, who_add) pre_items = [i for i in out_globs.items()] out_globs[glob_add] = who_add.copy() for glob_have, who_have in pre_items: @@ -166,7 +164,7 @@ def expand_directives(root, directives): if intersect: for f in files_add: if f not in intersect: - out_globs[os.path.relpath(root, f)] = who_add + out_globs[os.path.relpath(f, start=root)] = who_add for who in who_have: if who not in out_globs[glob_add]: out_globs[glob_add].append(who) @@ -186,7 +184,8 @@ def add_parent_to_globs(parent, globs, globs_dir): if intersect: for f in files_child: if f not in intersect: - globs[f] = gglob_who_orig.copy() + who = gglob_who_orig.copy() + globs[os.path.relpath(f, start=globs_dir)] = who for who in oglob_who: if who not in gglob_who: gglob_who.append(who) -- cgit v1.2.3 From 75cb3c25d9fe9d068907e829dffd85c2fceaeea8 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 14 Jul 2017 12:02:27 -0700 Subject: Add @muxi and @makdharma as owners of ObjC related files --- OWNERS | 2 ++ examples/objective-c/OWNERS | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 examples/objective-c/OWNERS diff --git a/OWNERS b/OWNERS index 87958a4566..7e6a84c57a 100644 --- a/OWNERS +++ b/OWNERS @@ -5,3 +5,5 @@ @ctiller @murgatroid99 binding.gyp Gemfile grpc.gemspec package.json Rakefile +@muxi *.podspec grpc.bzl +@makdharma *.podspec grpc.bzl diff --git a/examples/objective-c/OWNERS b/examples/objective-c/OWNERS new file mode 100644 index 0000000000..c14fe53c06 --- /dev/null +++ b/examples/objective-c/OWNERS @@ -0,0 +1,2 @@ +@muxi +@makdharma -- cgit v1.2.3 From 000bb685a8371ed68d364c5b007d33d100c8848a Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Fri, 14 Jul 2017 13:44:56 -0700 Subject: mkowners --- .github/CODEOWNERS | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 66f201c955..61f30484d8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,34 +7,37 @@ /grpc.gemspec @murgatroid99 /package.json @murgatroid99 /Rakefile @murgatroid99 +/*.podspec @muxi @makdharma +/grpc.bzl @muxi @makdharma /bazel/** @nicolasnoble @dgquintas @ctiller -/cmake/** @jtattermusch @a11r @nicolasnoble @ctiller +/cmake/** @jtattermusch @a11r @nicolasnoble @ctiller @muxi @makdharma /doc/PROTOCOL-HTTP2.md @ejona86 @a11r @nicolasnoble @ctiller /doc/interop-test-descriptions.md @ejona86 @a11r @nicolasnoble @ctiller -/etc/** @jboeuf @nicolasnoble @a11r @ctiller -/examples/node/** @murgatroid99 @a11r @nicolasnoble @ctiller +/etc/** @jboeuf @nicolasnoble @a11r @ctiller @muxi @makdharma +/examples/node/** @murgatroid99 @a11r @nicolasnoble @ctiller @muxi @makdharma +/examples/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller /examples/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada -/include/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble +/include/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble @muxi @makdharma /src/core/** @ctiller @markdroth @dgquintas /src/core/lib/iomgr/*_uv.c @murgatroid99 @ctiller @markdroth @dgquintas /src/core/lib/iomgr/*_uv.h @murgatroid99 @ctiller @markdroth @dgquintas /src/cpp/** @ctiller @markdroth @dgquintas -/src/csharp/** @jtattermusch @apolcyn @a11r @nicolasnoble @ctiller -/src/node/** @murgatroid99 @a11r @nicolasnoble @ctiller +/src/csharp/** @jtattermusch @apolcyn @a11r @nicolasnoble @ctiller @muxi @makdharma +/src/node/** @murgatroid99 @a11r @nicolasnoble @ctiller @muxi @makdharma /src/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/php/** @stanley-cheung @murgatroid99 @a11r @nicolasnoble @ctiller +/src/php/** @stanley-cheung @murgatroid99 @a11r @nicolasnoble @ctiller @muxi @makdharma /src/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /src/python/grpcio/grpc_core_dependencies.py @a11y @ctiller @nicolasnoble @nathanielmanistaatgoogle @kpayson64 @mehrdada -/src/ruby/** @apolcyn @murgatroid99 @a11r @nicolasnoble @ctiller -/test/build/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble +/src/ruby/** @apolcyn @murgatroid99 @a11r @nicolasnoble @ctiller @muxi @makdharma +/test/build/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble @muxi @makdharma /test/core/** @ctiller @markdroth @dgquintas /test/cpp/** @ctiller @markdroth @dgquintas /test/cpp/qps/** @vjpai @ctiller @markdroth @dgquintas -/test/distrib/node/** @murgatroid99 @a11r @nicolasnoble @ctiller -/tools/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller +/test/distrib/node/** @murgatroid99 @a11r @nicolasnoble @ctiller @muxi @makdharma +/tools/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller @muxi @makdharma /tools/codegen/core/** @ctiller @dgquintas @markdroth /tools/distrib/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada -/tools/dockerfile/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller -/tools/run_tests/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller -/tools/run_tests/artifacts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller -/tools/run_tests/helper_scripts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller +/tools/dockerfile/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller @muxi @makdharma +/tools/run_tests/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller @muxi @makdharma +/tools/run_tests/artifacts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller @muxi @makdharma +/tools/run_tests/helper_scripts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller @muxi @makdharma -- cgit v1.2.3 From 98240d07b42db041d9766ce5e97840550e8d6c27 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 14 Jul 2017 14:16:01 -0700 Subject: Fix another merging bug in mkowners --- .github/CODEOWNERS | 195 --------------------------------------------- tools/mkowners/mkowners.py | 30 +++++-- 2 files changed, 24 insertions(+), 201 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c0f2bda3a2..e4e7c47c5a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,56 +16,6 @@ /etc/** @jboeuf @nicolasnoble @a11r @ctiller /examples/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /examples/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/AppDelegate.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/SelectUserViewController.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Images.xcassets/first.imageset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/main.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Images.xcassets/first.imageset/first.pdf @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Images.xcassets/second.imageset/second.pdf @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/MakeRPCViewController.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/RouteGuideClient.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/AppDelegate.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Images.xcassets/AppIcon.appiconset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Images.xcassets/AppIcon.appiconset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/AppDelegate.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/main.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/ViewControllers.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Images.xcassets/first.imageset/first.pdf @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/OWNERS @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/SelectUserViewController.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/AppDelegate.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/helloworld/HelloWorld/ViewController.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Images.xcassets/second.imageset/second.pdf @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/MakeRPCViewController.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/RouteGuideClient.xcodeproj/xcshareddata/xcschemes/RouteGuideClient.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/route_guide_db.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/AppDelegate.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Images.xcassets/second.imageset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/RouteGuideClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/AppDelegate.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/main.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/GoogleService-Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/AuthSample.xcodeproj/xcshareddata/xcschemes/AuthSample.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Images.xcassets/second.imageset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/AuthSample.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/AuthSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Misc/Images.xcassets/first.imageset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/auth_sample/Misc/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/examples/objective-c/route_guide/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller /examples/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /include/** @ctiller @markdroth @dgquintas @a11r @nicolasnoble /src/core/** @ctiller @markdroth @dgquintas @@ -75,149 +25,6 @@ /src/csharp/** @jtattermusch @apolcyn @a11r @nicolasnoble @ctiller /src/node/** @murgatroid99 @a11r @nicolasnoble @ctiller /src/objective-c/** @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/CronetUnitTests/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/build_tests.sh @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXForwardingWriter.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoService.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter+Transformations.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCWrappedCall.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+OAuth2.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCChannel.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTestsRemote.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter+Immediate.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/CoreCronetEnd2EndTests/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/change-comments.py @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTestsLocalSSL.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXForwardingWriter.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTestsRemoteWithCronet/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTestsRemoteWithCronet/InteropTestsRemoteWithCronet.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoMethod.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/OWNERS @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoRPC.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXConcurrentWriteable.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSData+GRPC.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXImmediateSingleWriter.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/main.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/ConnectivityTestingApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/RemoteTestClient/test.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSDictionary+GRPC.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/AppDelegate.swift @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSFastEnumerator.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/RemoteTestClient/test.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXConcurrentWriteable.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/ViewController.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/CronetUnitTests/CronetUnitTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTestsLocalCleartext.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemoteWithCronet.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/build_example_test.sh @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCHost.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/RxLibraryUnitTests.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+Cronet.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+Cronet.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/xcshareddata/xcschemes/SwiftSample.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCCompletionQueue.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/Images.xcassets/AppIcon.appiconset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoMethod.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXBufferedPipe.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXImmediateWriter.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/run_tests.sh @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/RemoteTestClient/messages.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSError+GRPC.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/AllTests.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/InteropTests.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter+Transformations.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/format-all-comments.sh @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXBufferedPipe.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+OAuth2.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCHost.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriteable.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSData+GRPC.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCRequestHeaders.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/build_one_example.sh @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoService.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCRequestHeaders.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSError+GRPC.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/AppDelegate.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/CoreCronetEnd2EndTests.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/internal_testing/GRPCCall+InternalTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/README.md @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCWrappedCall.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSFastEnumerator.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/Images.xcassets/AppIcon.appiconset/Contents.json @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/ViewController.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/PluginTest/imported-with-dash.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter+Immediate.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/main.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/ViewController.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/transformations/GRXMappingWriter.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+Tests.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSBlockEnumerator.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/TestCertificates.bundle/test-certificates.pem @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSScalarEnumerator.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/RemoteTestClient/messages.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/SwiftSample.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/CronetUnitTests.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCOpBatchLog.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/Base.lproj/Main.storyboard @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalCleartext.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/internal_testing/GRPCCall+InternalTests.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+ChannelCredentials.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsLocalSSL.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/ProtoRPC/ProtoRPC.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall+Tests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/AppDelegate.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/xcshareddata/xcschemes/InteropTestsRemote.xcscheme @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXImmediateWriter.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriter.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/transformations/GRXMappingWriter.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/RxLibraryUnitTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/NSEnumerator+GRXUtil.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/private/GRXNSScalarEnumerator.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/ViewController.swift @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Connectivity/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/SwiftSample/Podfile @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/Tests.xcodeproj/project.pbxproj @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/NSDictionary+GRPC.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXImmediateSingleWriter.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/GRPCClientTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCCompletionQueue.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCOpBatchLog.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCReachabilityFlagNames.xmacro.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/version.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/PluginTest/test-dash-filename.proto @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCConnectivityMonitor.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/RxLibrary/GRXWriteable.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/examples/Sample/Sample/Info.plist @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/GRPCCall.h @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/tests/CoreCronetEnd2EndTests/CoreCronetEnd2EndTests.m @muxi @makdharma @a11r @nicolasnoble @ctiller -/src/objective-c/GRPCClient/private/GRPCChannel.m @muxi @makdharma @a11r @nicolasnoble @ctiller /src/php/** @stanley-cheung @murgatroid99 @a11r @nicolasnoble @ctiller /src/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada /src/python/grpcio/grpc_core_dependencies.py @a11y @ctiller @nicolasnoble @nathanielmanistaatgoogle @kpayson64 @mehrdada @@ -230,7 +37,5 @@ /tools/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/codegen/core/** @ctiller @dgquintas @markdroth /tools/distrib/python/** @nathanielmanistaatgoogle @kpayson64 @mehrdada -/tools/dockerfile/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller -/tools/run_tests/** @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/run_tests/artifacts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller /tools/run_tests/helper_scripts/*_node* @murgatroid99 @matt-kwong @jtattermusch @nicolasnoble @a11r @ctiller diff --git a/tools/mkowners/mkowners.py b/tools/mkowners/mkowners.py index 4805df45df..2ccedfcfb8 100755 --- a/tools/mkowners/mkowners.py +++ b/tools/mkowners/mkowners.py @@ -132,7 +132,7 @@ def git_glob(glob): global gg_cache if glob in gg_cache: return gg_cache[glob] r = set(subprocess - .check_output(['git', 'ls-files', glob]) + .check_output(['git', 'ls-files', os.path.join(git_root, glob)]) .decode('utf-8') .strip() .splitlines()) @@ -150,7 +150,7 @@ def expand_directives(root, directives): globs[glob].append(directive.who) # expand owners for intersecting globs sorted_globs = sorted(globs.keys(), - key=lambda g: len(git_glob(os.path.join(root, g))), + key=lambda g: len(git_glob(full_dir(root, g))), reverse=True) out_globs = collections.OrderedDict() for glob_add in sorted_globs: @@ -162,8 +162,9 @@ def expand_directives(root, directives): files_have = git_glob(full_dir(root, glob_have)) intersect = files_have.intersection(files_add) if intersect: - for f in files_add: + for f in sorted(files_add): # sorted to ensure merge stability if f not in intersect: + print("X", root, glob_add, glob_have) out_globs[os.path.relpath(f, start=root)] = who_add for who in who_have: if who not in out_globs[glob_add]: @@ -182,8 +183,9 @@ def add_parent_to_globs(parent, globs, globs_dir): intersect = files_parent.intersection(files_child) gglob_who_orig = gglob_who.copy() if intersect: - for f in files_child: + for f in sorted(files_child): # sorted to ensure merge stability if f not in intersect: + print("Y", full_dir(owners.dir, oglob), full_dir(globs_dir, gglob)) who = gglob_who_orig.copy() globs[os.path.relpath(f, start=globs_dir)] = who for who in oglob_who: @@ -199,6 +201,7 @@ with open(args.out, 'w') as out: out.write('# Auto-generated by the tools/mkowners/mkowners.py tool\n') out.write('# Uses OWNERS files in different modules throughout the\n') out.write('# repository as the source of truth for module ownership.\n') + written_globs = [] while todo: head, *todo = todo if head.parent and not head.parent in done: @@ -207,6 +210,21 @@ with open(args.out, 'w') as out: globs = expand_directives(head.dir, head.directives) add_parent_to_globs(head.parent, globs, head.dir) for glob, owners in globs.items(): - out.write('/%s %s\n' % ( - full_dir(head.dir, glob), ' '.join(owners))) + skip = False + for glob1, owners1, dir1 in reversed(written_globs): + files = git_glob(full_dir(head.dir, glob)) + files1 = git_glob(full_dir(dir1, glob1)) + intersect = files.intersection(files1) + if files == intersect: + if sorted(owners) == sorted(owners1): + skip = True # nothing new in this rule + break + elif intersect: + # continuing would cause a semantic change since some files are + # affected differently by this rule and CODEOWNERS is order dependent + break + if not skip: + out.write('/%s %s\n' % ( + full_dir(head.dir, glob), ' '.join(owners))) + written_globs.append((glob, owners, head.dir)) done.add(head.dir) -- cgit v1.2.3