Skip to content

Commit fc35615

Browse files
committed
Merge branch 'master' into grpc-js_channelz
2 parents 4b6ea2b + aeb4273 commit fc35615

File tree

211 files changed

+3143
-1279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+3143
-1279
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages/grpc-js-xds/src/generated/** linguist-generated
2+
packages/grpc-js-xds/interop/generated/** linguist-generated

MAINTAINERS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIB
88
for general contribution guidelines.
99

1010
## Maintainers (in alphabetical order)
11-
- [jiangtaoli2016](https://github.com/jiangtaoli2016), Google Inc.
11+
1212
- [jtattermusch](https://github.com/jtattermusch), Google Inc.
1313
- [murgatroid99](https://github.com/murgatroid99), Google Inc.
1414
- [nicolasnoble](https://github.com/nicolasnoble), Google Inc.
15-
- [ofrobots](https://github.com/ofrobots), Google Inc.
1615
- [srini100](https://github.com/srini100), Google Inc.
17-
- [WeiranFang](https://github.com/WeiranFang), Google Inc.
1816
- [wenbozhu](https://github.com/wenbozhu), Google Inc.
1917

2018
## Emeritus Maintainers (in alphabetical order)
19+
- [jiangtaoli2016](https://github.com/jiangtaoli2016), Google Inc.
2120
- [kjin](https://github.com/kjin), Google Inc.
2221
- [matt-kwong](https://github.com/matt-kwong), Google Inc.
23-
22+
- [ofrobots](https://github.com/ofrobots), Google Inc.
23+
- [WeiranFang](https://github.com/WeiranFang), Google Inc.
24+

TROUBLESHOOTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This guide is for troubleshooting the `grpc-js` library for Node.js
44

55
## Enabling extra logging and tracing
66

7-
Extra logging can be very useful for diagnosing problems. `grpc-js` supporst
7+
Extra logging can be very useful for diagnosing problems. `grpc-js` supports
88
the `GRPC_VERBOSITY` and `GRPC_TRACE` environment variables that can be used to increase the amount of information
99
that gets printed to stderr.
1010

packages/grpc-js-xds/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ const client = new MyServiceClient('xds:///example.com:123');
2222
## Supported Features
2323

2424
- [xDS-Based Global Load Balancing](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md)
25-
- [xDS traffic splitting and routing](https://github.com/grpc/proposal/blob/master/A28-xds-traffic-splitting-and-routing.md)
25+
- [xDS traffic splitting and routing](https://github.com/grpc/proposal/blob/master/A28-xds-traffic-splitting-and-routing.md)
26+
- [xDS v3 API](https://github.com/grpc/proposal/blob/master/A30-xds-v3.md)
27+
- [xDS Timeouts](https://github.com/grpc/proposal/blob/master/A31-xds-timeout-support-and-config-selector.md)
28+
- [xDS Circuit Breaking](https://github.com/grpc/proposal/blob/master/A32-xds-circuit-breaking.md)
29+
- [xDS Client-Side Fault Injection](https://github.com/grpc/proposal/blob/master/A33-Fault-Injection.md)

packages/grpc-js-xds/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"prepare": "npm run compile",
1313
"pretest": "npm run compile",
1414
"posttest": "npm run check",
15-
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/udpa/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v2/ads.proto envoy/service/load_stats/v2/lrs.proto envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto",
15+
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs deps/envoy-api/ deps/udpa/ deps/googleapis/ deps/protoc-gen-validate/ -O src/generated/ --grpcLib @grpc/grpc-js envoy/service/discovery/v2/ads.proto envoy/service/load_stats/v2/lrs.proto envoy/service/discovery/v3/ads.proto envoy/service/load_stats/v3/lrs.proto envoy/config/listener/v3/listener.proto envoy/config/route/v3/route.proto envoy/config/cluster/v3/cluster.proto envoy/config/endpoint/v3/endpoint.proto envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto udpa/type/v1/typed_struct.proto envoy/extensions/filters/http/fault/v3/fault.proto",
1616
"generate-interop-types": "proto-loader-gen-types --keep-case --longs String --enums String --defaults --oneofs --json --includeComments --includeDirs proto/ -O interop/generated --grpcLib @grpc/grpc-js grpc/testing/test.proto"
1717
},
1818
"repository": {

packages/grpc-js-xds/scripts/xds.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ git clone -b master --single-branch --depth=1 https://github.com/grpc/grpc.git
4848

4949
grpc/tools/run_tests/helper_scripts/prep_xds.sh
5050

51-
GRPC_NODE_TRACE=xds_client,xds_resolver,cds_balancer,eds_balancer,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver \
51+
GRPC_NODE_TRACE=xds_client,xds_resolver,cds_balancer,eds_balancer,priority,weighted_target,round_robin,resolving_load_balancer,subchannel,keepalive,dns_resolver,fault_injection,http_filter \
5252
GRPC_NODE_VERBOSITY=DEBUG \
5353
NODE_XDS_INTEROP_VERBOSITY=1 \
5454
python3 grpc/tools/run_tests/run_xds_tests.py \
55-
--test_case="all,timeout,circuit_breaking" \
55+
--test_case="all,timeout,circuit_breaking,fault_injection" \
5656
--project_id=grpc-testing \
5757
--source_image=projects/grpc-testing/global/images/xds-test-server-4 \
5858
--path_to_server_binary=/java_server/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/xds-test-server \

packages/grpc-js-xds/src/environment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*
16-
*/
16+
*/
17+
18+
export const EXPERIMENTAL_FAULT_INJECTION = (process.env.GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION ?? 'true') === 'true';

packages/grpc-js-xds/src/fraction.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2021 gRPC authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { FractionalPercent__Output } from "./generated/envoy/type/v3/FractionalPercent";
18+
19+
export interface Fraction {
20+
numerator: number;
21+
denominator: number;
22+
}
23+
24+
export function fractionToString(fraction: Fraction): string {
25+
return `${fraction.numerator}/${fraction.denominator}`;
26+
}
27+
28+
const RUNTIME_FRACTION_DENOMINATOR_VALUES = {
29+
HUNDRED: 100,
30+
TEN_THOUSAND: 10_000,
31+
MILLION: 1_000_000
32+
}
33+
34+
export function envoyFractionToFraction(envoyFraction: FractionalPercent__Output): Fraction {
35+
return {
36+
numerator: envoyFraction.numerator,
37+
denominator: RUNTIME_FRACTION_DENOMINATOR_VALUES[envoyFraction.denominator]
38+
};
39+
}

packages/grpc-js-xds/src/generated/ads.ts

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/grpc-js-xds/src/generated/cluster.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)