Skip to content

Hystrix admin port squashed pr#2

Merged
trabetti merged 62 commits intohystrix_admin_portfrom
hystrix_admin_port_squashed_pr
Jan 28, 2018
Merged

Hystrix admin port squashed pr#2
trabetti merged 62 commits intohystrix_admin_portfrom
hystrix_admin_port_squashed_pr

Conversation

@trabetti
Copy link
Copy Markdown
Owner

@trabetti trabetti commented Jan 25, 2018

this suppose to be updated with upstream, after merge.
(master is also updated to upstream)
There are mainly cosmetic changes, and comments added.
It compiles and run correctly.
There are many files, since I merged to upstream and did changes in the same PR (it was not suppose to be like that, but that happened because of all the mess).
But you know which are ours, so you only need to check them.

edit: I am not sure it compiles. seems some BUILD files were not pushed :(
I am adding them in next PR.

jrajahalme and others added 30 commits January 11, 2018 14:34
…#2328)

Configuration options for different protocols are no longer mutually
exclusive in the v2 API.

Backwards compatibility is maintained by requiring that only one of
HTTP/1 or HTTP/2 options be present when the new cluster option
'protocol_selection' is in it's default value
('EXCLUSIVE_AS_CONFIGURED').

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: Kyle Myerson <kmyerson@google.com>
Signed-off-by: Louis Taylor <louis@kragniz.eu>
Risk Level: Low
Testing: Unit
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Matt Klein <mklein@lyft.com>
Implements Metrics Service in Envoy that continuously streams metrics to the gRPC end point configured.

Risk Level: Small-medium
Testing: unit test, integration test

Docs Changes:

Data Plane PR

Release Notes:

Release notes updated

API Changes:

Data Plane API

Signed-off-by: Rama <ramaraochavali@gmail.com>
Signed-off-by: Louis Taylor <louis@kragniz.eu>
Signed-off-by: Dhi Aurrahman <dio@hooq.tv>
Signed-off-by: Louis Taylor <louis@kragniz.eu>
Signed-off-by: Alexey Baranov <me@kotiki.cc>
Subpar uses Python, which doesn't like it when we don't have
PYTHONUSERBASE (hidden by Bazel hermeticity) set or getpwuid()
resolution to user (missing in /etc/passwd). This is a workaround based
on JonathonReinhart/scuba#11 to get build
happening on Linux when non-root.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Louis Taylor <louis@kragniz.eu>
In order to support a singleton gRPC manager (managing TLS state,
connection pools for the Google gRPC client, etc.), this PR removes the
use of templating in Grpc::AsyncClient and its related interfaces.

We initially used templates as they were an easy way to propagate type
information. However, we can avoid using them by taking advantage of the
Protobuf::Message superclass interface. There is some convenience in
using templating for the request/stream callbacks, adapter template
classes are provided to make this possible.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
Moving Server::Listener to Network::ListenerConfig helps avoid
dependency from Network namespace to Server namespace in following
changes.

Requested-by: Matt Klein <mklein@lyft.com>
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: Matt Klein <mklein@lyft.com>
Congratulations! Maybe? ;)

Signed-off-by: Matt Klein <mklein@lyft.com>
…y#2363)

Make gRPC-JSON transcoder not buffering response at end_stream or non-gRPC response.

Risk Level: Low

Testing:
unit test

Docs Changes:
N/A

Release Notes:
N/A

Fixes envoyproxy#2275

Signed-off-by: Lizan Zhou <zlizan@google.com>
Signed-off-by: Dhi Aurrahman <dio@hooq.tv>
Signed-off-by: Gabriel <gsagula@gmail.com>
This is a prereq for running CI on envoyproxy#2348

Description:
Integrates github.com/google/benchmark so it can be used in future PRs for demonstrating improvement. Note this PR does not actually depend on it, so it can pass CI.

Risk Level: Low

Tested: //test/...

Signed-off-by: Joshua Marantz <jmarantz@google.com>
The current problem with lua is that it is unable to use external
libraries such as lrexlib installed via luarocks.

The solution is to export the symbols needed by those libraries.

Signed-off-by: Nicholas J <nicholas.a.johns5@gmail.com>
When the structure of shared memory is
[100 options slots][control struct] and we try parse it as [99 options][control struct] we end up parsing the control struct from the uninitialized options memory. Fixed via memset.

Risk Level: n/a (test fix)
Testing: exactly.
Release Notes: n/a

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Taiki Ono <taiks.4559@gmail.com>
Signed-off-by: Matt Klein <mklein@lyft.com>
jmarantz and others added 23 commits January 22, 2018 11:52
…s shared-memory (envoyproxy#2424)

Signed-off-by: Joshua Marantz <jmarantz@google.com>
Description:
The Envoy API accepts regular expressions for several configuration options. If an invalid regular expression is provided, STL throws std::regex_error, which is uncaught and causes the sudden termination of Envoy. Replace use of the std::regex(std::string) constructor with calls to a new utility RegexUtil::parseRegex() which converts the std::regex_error into an EnvoyException, allowing the invalid configuration to be handled gracefully.

Risk Level: Low

Testing:
Unit tests for behavior or new utility function and testing of invalid regular expressions in configuration.

Release Notes: N/A

Fixes: envoyproxy#2406

Signed-off-by: Stephan Zuercher stephan@turbinelabs.io
…y#2248)

File-based BoringSSL APIs are no longer used and everything is processed
as if it was delivered inline in order to provide consistent behavior.

Additionally, DataSource files are now read during configuration parsing,
which means that the configuration is considered invalid if it refers to
non-existing files.

Fixes envoyproxy#1357.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
…envoyproxy#2387)

Description:
Extend the health check filter to optionally compute its HTTP response status
based on whether at least a specified percentage of servers in a specified set
of upstream clusters are healthy.

Risk Level: Medium

Testing: Unit tests included

Docs Changes: envoyproxy#425

Release Notes: Included in this PR

Fixes: envoyproxy#2362

API Changes: envoyproxy#417

Signed-off-by: Brian Pane bpane@pinterest.com
…s. (envoyproxy#2427)

This PR is the next in the series of patches to integrate the Google gRPC client. There are two
parts:

1. The bulk of the existing Grpc::AsyncClientImpl unit tests have been re-expressed as TCP loopback
   integration tests with a FakeUpstream. This allows direct reuse with the Google gRPC client
   libraries, since they are a blackbox that can't be easily mocked internally. The test is also now
   paramaterized by client type, with the Google gRPC implementation elided in this PR.

2. To produce behavioral parity between clients, Grpc::AsyncClientImpl has been modified where its
   behavior differed from the Google gRPC client (which is effectively the gRPC reference
   implementation). Specifically, initial/trailer metadata callbacks, error handling and HTTP ->
   gRPC status mapping behavior have been modified. Remote stream closes, even with OK grpc-status
   now terminate the stream regardless of local stream close behavior.

Testing: Unit/integration tests as described above.
Risk Level: Medium (behavior changes to Grpc::AsyncClientImpl, used for config discovery, rate limiting, access logs and metrics service).

Signed-off-by: Harvey Tuch <htuch@google.com>
Adds a benchmarking for new string utility functions added in envoyproxy#2368 using the google microbenchmarking library (https://github.com/google/benchmark), which was added in envoyproxy#2350. This serves as an example and proof of concept on how to use the benchmarking library, and as a reference point for the approximate performance of some string-parsing functions.

Risk Level: Very Low

Testing:
This is just a new speed-test, so running it on its own is sufficient to test it.

Results:

2018-01-18 08:01:44
Run on (12 X 3800 MHz CPU s)
CPU Caches:
  L1 Data 32K (x6)
  L1 Instruction 32K (x6)
  L2 Unified 256K (x6)
  L3 Unified 15360K (x1)
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
-------------------------------------------------------------------------------------
Benchmark                                              Time           CPU Iterations
-------------------------------------------------------------------------------------
BM_RTrimStringView                                    11 ns         11 ns   54467092
BM_RTrimStringViewAlreadyTrimmed                       9 ns          9 ns   77143046
BM_RTrimStringViewAlreadyTrimmedAndMakeString         24 ns         24 ns   29094696
BM_FindToken                                         165 ns        165 ns    4230849
BM_FindTokenValueNestedSplit                         427 ns        427 ns    1653627
BM_FindTokenValueSearchForEqual                      180 ns        180 ns    4046401

In practice I did not find this benchmark to be noisy on repeated runs.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
it adds http_proxy env variables which can be used while building the image
user is expected to set http_proxy and https_proxy in the env before running the build command.

Risk Level: Low

Testing: tested in a proxy env

Signed-off-by: Sudeepto Roy <sudeepto.roy@gmail.com>
Waiting for first dispatch loop is too late for ADS use with Google gRPC client.

Testing: ADS integration test with Google gRPC client, existing tests.
Risk Level: Low

Signed-off-by: Harvey Tuch <htuch@google.com>
When a subscription is for the empty set, rather than a specific set of services, avoid sending an
empty request when the watch ends.

Signed-off-by: Harvey Tuch <htuch@google.com>
…#2434)

Testing: New paramaterized integration tests.
Risk Level: Low

Signed-off-by: Harvey Tuch <htuch@google.com>
Network::ListenerImpl class implements an libevent socket
listener. Factor out all functionality that is not directly libevent
related to ConnectionHandlerImpl, which both reduces overall
complexity and makes it possible to refactor configurable listener
behavior to a new class of listener filters in the following patches.

This patch also reduces the special handling for SSL connections by
introducing a new dispatcher member for creating server
connections. This is used by the refactored code as the connection
creation is now shifted from Network::Listener to the connection
handler.

To further simplify the resulting code, this patch removes
Network::ListenerOptions class, as the only option that now needs to
be passed to Network::Listener is the "bind to port" boolean, which is
now passed in explicitly.  All other listener options are handled by
passing along Server::Listener instead.

Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
Signed-off-by: Jarno Rajahalme <jarno@covalent.io>
One of the BoringSSL updates we've picked up in the last few months fixed the need for extra flags when compiling BoringSSL in Xcode 9.

Risk Level: Low
Testing: existing CI is sufficient
Release Notes: N/A

Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
…xy#2447)

UBSAN doesn't show stack traces by default, so this diff adds the environment variable
needed to enable stack traces.

Risk Level: Low

Testing: The CircleCI ASAN run will exercise this code change.

Docs Changes: N/A

Release Notes: N/A

Signed-off-by: Brian Pane <bpane@pinterest.com>
…envoyproxy#2448)

This PR fixes envoyproxy#2379 (Linux) by passing --non-unique to docker command. This option allows creating duplicate users.

Risk Level: Low

Testing: manual OsX, Linux

Signed-off-by: Gabriel <gsagula@gmail.com>
Signed-off-by: Matt Rice <mattrice@google.com>
hystrix_data->stats_->incCounter();

for (const Stats::CounterSharedPtr& counter : server.stats().counters()) {
// we save all upstream_rq stats. could be more specific.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't understand the comment. I think we should delete it

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

(const_cast<Network::Connection*>((hystrix_data->callbacks_)->connection()))->write(data);

const auto ms = std::chrono::milliseconds(Stats::HYSTRIX_ROLLING_WINDOW_IN_MS/Stats::HYSTRIX_NUM_OF_BUCKETS);
// TODO: move this outside to fixed place?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should move move it to the header file as a const variable. Also relevant to the variable in ping function

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried and didn't work, maybe you can try?

// is there an alternative to the const_cast?
(const_cast<Network::Connection*>((hystrix_data->callbacks_)->connection()))->write(data);

// TODO: move this outside to fixed place?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as before

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same reply as before ;)

addIntToStream("currentConcurrentExecutionCount", 0, cluster_info);
addIntToStream("latencyExecute_mean", 0, cluster_info);

// latency information can be taken rom hystogram, which is only available to sinks
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment for the whole function. We should consider creating a const variable for all constant values here. Instead of passing them "hard coded"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. something like "NA"? better idea for a name?

@trabetti trabetti merged commit f80bf27 into hystrix_admin_port Jan 28, 2018
@trabetti trabetti deleted the hystrix_admin_port_squashed_pr branch January 28, 2018 07:46
trabetti added a commit that referenced this pull request Apr 24, 2018
Signed-off-by: trabetti <talis@il.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.