Commit Graph

93 Commits

Author SHA1 Message Date
Arvind Bright 8ba23be961
cmd/protoc-gen-go-grpc: bump -version to 1.3.0 for release (#6064) 2023-03-01 09:58:20 -08:00
Doug Fawley bf3ad35240
*: update all dependencies (#5924) 2023-01-11 13:49:41 -08:00
Doug Fawley 70617b11fa
vet & github: run vet separately from tests; make vet-proto only check protos (#5873) 2022-12-16 16:37:31 -08:00
Doug Fawley 3011eaf70e
test/tools: update staticcheck version to latest (#5806) 2022-11-18 13:51:43 -08:00
Doug Fawley 8062981d4e
vet: workaround buggy mac git grep behavior (#5716) 2022-10-12 09:52:45 -07:00
Easwar Swaminathan 9bc72deba4
grpc: remove mentions of WithBalancerName from comments (#5555) 2022-08-02 15:56:37 -07:00
Eric Butler ebc30b8fc3
reflection: use protobuf/reflect instead of go reflection, fix dynamic messages (#5180) 2022-02-15 11:01:42 -08:00
Easwar Swaminathan 46ab723bb2
multiple: remove appengine specific build constraints and code (#4685) 2021-08-24 12:30:13 -07:00
Doug Fawley aa1169ab7c
vet: remove support for non-module-aware Go versions (#4530) 2021-06-09 10:01:40 -07:00
ZhenLian 5730f8d113
Invoke Go Vet Check in Sub-modules (#4302)
* Invoke Go Vet Check in Sub-modules
2021-04-02 11:19:22 -07:00
Menghan Li d5b628860d
vet: set PATH to HOME/go/bin, and print go version (#4254) 2021-03-09 14:03:51 -08:00
Doug Fawley 25cf9393fa
vet: allow golint to run on generated protos (#4220) 2021-02-22 16:04:34 -08:00
Menghan Li 9f3606cd0f
xds: xds_cluster_impl_balancer part 1 (#4154)
Part of C2P fallback. To support fallback to a DNS cluster.

This PR adds implementation of xds_cluster_impl_balancer, which will be responsible for circuit breaking and rpc dropping.

This PR only added RPC dropping. Circuit breaking will be done in a followup PR, after some necessary refactoring.
2021-02-11 15:03:39 -08:00
Timothy Gu 20636e76a9
protobuf: update protoc to latest version (#4038)
Presently, protoc 3.3.0 (released in 2017) is still being used. This
commit updates the vet.sh script as well as existing generated files to
use protoc 3.14.0 instead.

The only concrete change this brings is updated import paths of
Timestamp and Duration types. However, in practice this is a no-op,
since the types themselves are already aliased to the new import path:

- https://pkg.go.dev/github.com/golang/protobuf@v1.4.3/ptypes/duration#Duration
- https://pkg.go.dev/github.com/golang/protobuf@v1.4.3/ptypes/timestamp#Timestamp
2020-11-16 16:59:46 -08:00
Doug Fawley f4d9cca4f7
github: add Github Actions workflow for tests; support in vet.sh (#4005) 2020-10-30 14:37:13 -07:00
Easwar Swaminathan 06c094c3ab
xds/client: Process security configuration from Cluster resource (#3931) 2020-10-08 15:50:51 -07:00
Garrett Gutierrez ff1fc890e4
internal: reintroduce legacy appengine build constraints (#3838) 2020-08-25 13:49:57 -07:00
Easwar Swaminathan 0baf4c2d4c
meshca: Pull in the MeshCA config proto from grpc-proto repo. (#3807) 2020-08-13 08:58:51 -07:00
Menghan Li 8beeedb8b1
internal: clean up all usages of grpclog, and replace with component (#3719) 2020-08-06 13:19:17 -07:00
Doug Fawley bc714cd8ae
Remove Go 1.9 / AppEngine support; assume go1.12 build tag (#3767) 2020-07-30 16:15:35 -07:00
Menghan Li d6c4e49aab
internal: delete mock from examples (#3766) 2020-07-29 13:03:27 -07:00
Menghan Li c95dc4da23
doc: mark CustomCodec as deprecated (#3698) 2020-06-26 12:56:03 -07:00
Doug Fawley 38aafd89f8
vet.sh: require ALL modules are tidy; tidy some that are not (#3709) 2020-06-24 12:44:51 -07:00
Doug Fawley 4eb418e5b2
balancer: move Balancer and Picker to V2; delete legacy API (#3431) 2020-04-28 14:52:49 -07:00
Damien Neil 15653fec60
all: refactor .pb.go generation (#3451)
Replace various //go:generate lines and regenerate.sh scripts with a
single, top-level regenerate.sh that regenerates all .pb.go files.

Placing generation in a single script ensures that all files are
generated with similar parameters. The new regenerate.sh uses the
protoc-gen-go version defined in test/tools/go.mod and automatically
handles new .proto files as they are added.

Do some minor refactoring on .proto files: Every file now has a
go_package option (which will be required by a future version of the
code generator), and file imports are all relative to the repository
root.
2020-04-24 08:54:03 -07:00
Easwar Swaminathan 6a3c03883d
Pass address attributes from balancer to creds handshaker. (#3548) 2020-04-23 11:03:42 -07:00
Menghan Li c7079afb44
lint: fail on missing package comment (#3524)
golint does check for missing package comment, but with low confidence.
golint checks each file, and complains on every file missing package comment, even though another file in the same package has the comment.

This PR adds a golint check with low min_confidence, and filters out false-positives.
2020-04-15 09:59:17 -07:00
Menghan Li a783b25fe5
internal: rename proto import to end with pb (#3523) 2020-04-13 12:37:38 -07:00
Easwar Swaminathan 09c4b45e16
vet: Get it to work on Darwin. (#3452) 2020-03-19 08:51:10 -07:00
Egon Elbre 6cd03861bf
vet.sh: ensure vet runs on all packages (#3395) 2020-02-26 10:50:27 -08:00
Garrett Gutierrez a10661dd0a
credentials: deprecate ProtocolInfo.SecurityVersion (#3372)
credentials: deprecate ProtocolInfo.SecurityVersion (#3372)
2020-02-14 10:10:00 -08:00
Menghan Li 8c50fc2565
revert buffer reuse (#3338)
* Revert "stream: fix returnBuffers race during retry (#3293)"

This reverts commit ede71d589c.

* Revert "codec/proto: reuse of marshal byte buffers (#3167)"

This reverts commit 642675125e.
2020-01-27 13:30:41 -08:00
Doug Fawley c35a580b0c
Revert "balancer: move Balancer and Picker to V2; delete legacy… (#3315)
This reverts commit 336cf8d761.
2020-01-13 13:12:55 -08:00
Doug Fawley 336cf8d761
balancer: move Balancer and Picker to V2; delete legacy API (#3301) 2020-01-10 13:44:48 -08:00
Adhityaa Chandrasekar cf9eb4f51c benchmark: add support for payload size curves (#3248) 2020-01-06 14:45:41 -08:00
Adhityaa Chandrasekar 642675125e codec/proto: reuse of marshal byte buffers (#3167)
Performance benchmarks can be found below. Obviously, a 8 KiB
request/response is tailored to showcase this improvement as this is
where codec buffer reuse shines, but I've run other benchmarks too (like
1-byte requests and responses) and there's no discernable impact on
performance.

We do not allow reuse of buffers when stat handlers or binlogs are
turned on. This is because those two may need access to the data and
payload even after the data has been written to the wire. In such cases,
we never return the data back to the pool.

A buffer reuse threshold of 1 KiB was determined after several
experiments. There's diminished returns when buffer reuse is enabled for
smaller messages (actually, a negative impact).

unary-networkMode_none-bufConn_false-keepalive_false-benchTime_40s-trace_false-latency_0s-kbps_0-MTU_0-maxConcurrentCalls_6-reqSize_8192B-respSize_8192B-compressor_off-channelz_false-preloader_false
               Title       Before        After Percentage
            TotalOps       839638       906223     7.93%
             SendOps            0            0      NaN%
             RecvOps            0            0      NaN%
            Bytes/op    103788.29     80592.47   -22.35%
           Allocs/op       183.33       189.30     3.27%
             ReqT/op 1375662899.20 1484755763.20     7.93%
            RespT/op 1375662899.20 1484755763.20     7.93%
            50th-Lat    238.746µs    225.019µs    -5.75%
            90th-Lat    514.253µs    456.439µs   -11.24%
            99th-Lat    711.083µs    702.466µs    -1.21%
             Avg-Lat     285.45µs    264.456µs    -7.35%
2019-12-20 09:41:23 -08:00
Doug Fawley dc49de8acd
balancer: add V2Picker, ClientConn.UpdateState, SubConnState.ConnectionError (#3186)
Also implement V2 versions of base.*, xds, pickfirst, grpclb, and round robin balancers.
2019-11-21 10:27:29 -08:00
Easwar Swaminathan 24b653e8cc
xds: Don't override dialFunc in xdsClient in tests. (#3191)
* Add a helper to the fakexds package to return a ClientConn talking to
  the fake server.
* Tests will make use of this ClientConn wherever required, or they will
  directly pass the fake server's address as the balancerName to the
  xdsclient.New() function, thus exercising that code path as well.
* Add grpc.WithTimeout to list in vet.sh
2019-11-20 09:02:53 -08:00
Doug Fawley 51ac07fb67
vet: revise staticcheck strategy (#3152) 2019-11-08 14:46:57 -08:00
Doug Fawley 4717e3b570
resolver: add deprecation note to AddressType and its values (#3156) 2019-11-08 10:38:45 -08:00
Doug Fawley 0aa47d32da
resolver: introduce attributes package and use it for Address and State (#3151) 2019-11-06 16:53:23 -08:00
Menghan Li 459a38a0e3
grpclb: enter fallback if no balancer addresses are available (#3119)
This is necessary because there's another way to select grpclb (by specifying grpclb in service config's balancing policy field). So it's possible that grpclb is picked, but resolver doesn't have any balancer addresses.

When an update without balancer address is received, grpclb closes the underlying ClientConn to remote balancer, and enters fallback mode.

Note that grpclb waits until the ClientConn and the RPC goroutines are actually closed to do the fallback work. This can avoid race caused by async close.
2019-10-31 09:43:18 -07:00
Menghan Li ff5f0e93f5
xds: add script to regenerate orca (#3131) 2019-10-30 10:14:39 -07:00
Menghan Li 5367efb805
cleanup: no x/net/context (#3120)
Manual change + mockgen
2019-10-29 13:06:26 -07:00
Doug Fawley c0909e91a5
resolver: move dns and passthrough to internal (#3116)
Nobody should directly need to reference these packages.

This is technically a breaking change. However:

- Package dns was exporting a NewBuilder method. This should never have been necessary to use, but if so, it can be replaced by importing the "grpc" package and then using resolver.Get("dns").

- Package passthrough was not exporting any symbols and there was never a need to even blank-import it.

After as much searching as possible, it appears nobody in the open source community is referencing either of these packages.
2019-10-22 13:01:54 -07:00
Menghan Li 1610f0fd86
mod: move test/tools to a different module (#3086) 2019-10-14 09:31:07 -07:00
Doug Fawley e2cfd1c28f
internal: update proto library version (#3025)
Also, two fixes:

- Fix long-standing `.travis.yml` bug where `VET_SKIP_PROTO` was not `export`ed (so not seen by `vet.sh`).
- Update `vet.sh` to work with new `goimports -l` that does not print a `:` after filenames.
2019-09-17 13:49:26 -07:00
Doug Fawley 4ccf24ac5d
vet: ignore status code from grep -L (#3016) 2019-09-10 12:39:47 -07:00
Easwar Swaminathan dc1875474e
Implementation of the xds_experimental resolver. (#2967)
This resolver doesn't do much at this point, except returning an empty
address list and a hard-coded service config which picks the xds
balancer with a round_robin child policy.

Also moved the xdsConfig struct to the xds/internal package and exported
it as LBConfig, so that both the resolver and the balancer packages can
make use of this.
2019-08-21 11:24:53 -07:00
Easwar Swaminathan 36ddeccf18
Move code out of balancer/xds. (#2950)
We will have a root level xds/ directory which will eventually contain
all xDS implementation including balancer, resolver, client etc.

The new structure looks something like this:

grpc/
|
+--xds/
    |
    +--internal/
    |  |
    |  +--balancer/
    |     |
    |     +--edsbalancer/
    |     |
    |     +--lrs/
    |     |
    |     +--orca/
    |
    +--experimental/

Users need to import grpc/xds/experimental package to get all xds
functionality, and this will eventually be moved to grpc/xds.

Also, moved grpc/balancer/internal/wrr to grpc/internal/wrr.
2019-08-07 14:46:10 -07:00