Skip to content

Instantly share code, notes, and snippets.

View ivitjuk's full-sized avatar

Ivan Vitjuk ivitjuk

View GitHub Profile
@ivitjuk
ivitjuk / .gitignore
Last active December 25, 2015 20:49
Simulated annealing TSP in D3
*~
doc
@ivitjuk
ivitjuk / notify.py
Created February 7, 2014 01:56
WeeChat notify plugin with rate limiting and using notify-send
# Author: lavaramano <lavaramano AT gmail DOT com>
# Improved by: BaSh - <bash.lnx AT gmail DOT com>, Ivan Vitjuk <virtus@eclipsedminds.org>
# Ported to Weechat 0.3.0 by: Sharn - <sharntehnub AT gmail DOT com)
# This Plugin Calls the libnotify bindings via python when somebody says your nickname, sends you a query, etc.
# To make it work, you may need to download: python-notify (and libnotify - libgtk)
# Requires Weechat 0.3.0
# Released under GNU GPL v2
#
# 2013-07-30, Ivan Vitjuk <virtus@eclipsedminds.org>
# Rate limiting
@ivitjuk
ivitjuk / gist:954167c4117cea26929a38d7b73c170b
Last active November 16, 2018 20:29
Flaky test (build): //test/common/grpc:grpc_client_integration_test
$ gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ git clone https://github.com/envoyproxy/envoy.git && cd envoy && bazel build //source/exe:envoy-static
$ bazel test --runs_per_test=1000 //test/common/grpc:grpc_client_integration_test
real 0m37.864s
@ivitjuk
ivitjuk / gist:40d63bffd9a6cf12b738c628a1e48dc5
Created November 16, 2018 20:29
Flaky test (test log): //test/common/grpc:grpc_client_integration_test
bash-4.2# cat /root/.cache/bazel/_bazel_root/37e3aec351bcd85a6ea8b58e3592ef6e/execroot/envoy/bazel-out/k8-fastbuild/testlogs/test/common/grpc/grpc_client_integration_test/run_223_of_1000/test
.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //test/common/grpc:grpc_client_integration_test
-----------------------------------------------------------------------------
WARNING: Perftools heap leak checker is active -- Performance may suffer
[==========] Running 128 tests from 3 test cases.
[----------] Global test environment set-up.
[----------] 96 tests from IpVersionsClientType/GrpcClientIntegrationTest
[ RUN ] IpVersionsClientType/GrpcClientIntegrationTest.BasicStream/0
@ivitjuk
ivitjuk / gist:557a13f94fcb9e9e6c7452373cfe5bd2
Created January 29, 2019 18:26
Envoy log before CDS pause.
[2019-01-29 17:51:23.098][20][debug][config] [source/common/config/grpc_mux_impl.cc:96] Pausing discovery requests for type.googleapis.com/envoy.api.v2.ClusterLoadAssignment
[2019-01-29 17:51:23.103][20][info][upstream] [source/common/upstream/cluster_manager_impl.cc:472] add/update cluster cds_egress_bookstore_products_node_reviews2_node_http_8022 starting warming
[2019-01-29 17:51:23.108][20][info][upstream] [source/common/upstream/cluster_manager_impl.cc:472] add/update cluster cds_egress_bookstore_products_node_reviews3_node_http_8022 starting warming
[2019-01-29 17:51:23.108][20][debug][config] [source/common/config/grpc_mux_impl.cc:104] Resuming discovery requests for type.googleapis.com/envoy.api.v2.ClusterLoadAssignment
[2019-01-29 17:51:23.109][20][debug][config] [source/common/config/grpc_mux_impl.cc:96] Pausing discovery requests for type.googleapis.com/envoy.api.v2.RouteConfiguration
[2019-01-29 17:51:23.116][20][debug][config] [source/server/listener_manager_impl.cc:617] add warming listener: nam
@ivitjuk
ivitjuk / gist:c847808c125f9be29b493057aae8fb47
Created January 29, 2019 18:27
Envoy log after CDS pause.
[2019-01-29 17:48:54.879][21][debug][config] [source/common/config/grpc_mux_impl.cc:96] Pausing discovery requests for type.googleapis.com/envoy.api.v2.ClusterLoadAssignment
[2019-01-29 17:48:54.879][21][debug][config] [source/common/config/grpc_mux_impl.cc:96] Pausing discovery requests for type.googleapis.com/envoy.api.v2.Cluster
[2019-01-29 17:48:54.884][21][info][upstream] [source/common/upstream/cluster_manager_impl.cc:472] add/update cluster cds_egress_bookstore_products_node_reviews2_node_http_8022 starting warming
[2019-01-29 17:48:54.888][21][info][upstream] [source/common/upstream/cluster_manager_impl.cc:472] add/update cluster cds_egress_bookstore_products_node_reviews3_node_http_8022 starting warming
[2019-01-29 17:48:54.888][21][debug][config] [source/common/config/grpc_mux_impl.cc:104] Resuming discovery requests for type.googleapis.com/envoy.api.v2.ClusterLoadAssignment
[2019-01-29 17:48:54.889][21][debug][config] [source/common/config/grpc_mux_impl.cc:96] Pausing discovery requests for type.go
diff --git a/test/common/upstream/cluster_manager_impl_test.cc b/test/common/upstream/cluster_manager_impl_test.cc
index bcbf46007..b2424d2d5 100644
--- a/test/common/upstream/cluster_manager_impl_test.cc
+++ b/test/common/upstream/cluster_manager_impl_test.cc
@@ -1005,6 +1005,61 @@ TEST_F(ClusterManagerImplTest, DynamicRemoveWithLocalCluster) {
EXPECT_TRUE(Mock::VerifyAndClearExpectations(cluster1.get()));
}
+TEST_F(ClusterManagerImplTest, RemoveDnsWarmingCluster) {
+ time_system_.setSystemTime(std::chrono::milliseconds(1234567891234));
diff --git a/test/integration/ads_integration_test.cc b/test/integration/ads_integration_test.cc
index 568861736..d3a1358b3 100644
--- a/test/integration/ads_integration_test.cc
+++ b/test/integration/ads_integration_test.cc
@@ -503,6 +503,69 @@ TEST_P(AdsIntegrationTest, DuplicateWarmingClusters) {
test_server_->waitForCounterGe("cluster_manager.cds.update_rejected", 1);
}
+// Verify CDS get paused during cluster warming
+TEST_P(AdsIntegrationTest, CdsPausedDuringWarming) {