From 3c1a3d9f1b4c8ac573c0234f71534fd74cf2ec4b Mon Sep 17 00:00:00 2001 From: Juanli Shen Date: Thu, 6 Sep 2018 15:06:17 -0700 Subject: [PATCH] Fix subchannel key comparison if forcing creation --- src/core/ext/filters/client_channel/subchannel_index.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc index cb02b1a7480..4e155a28300 100644 --- a/src/core/ext/filters/client_channel/subchannel_index.cc +++ b/src/core/ext/filters/client_channel/subchannel_index.cc @@ -73,7 +73,8 @@ 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; + // To pretend the keys are different, return a non-zero value. + if (g_force_creation) return 1; int c = GPR_ICMP(a->args.filter_count, b->args.filter_count); if (c != 0) return c; if (a->args.filter_count > 0) {