Commit Graph

48 Commits

Author SHA1 Message Date
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
Doug Fawley 12906490e0
docs: clarify "deprecated" to indicate whether some features may be removed in 1.x (#2900)
Also, deprecate WithBalancerName (was experimental).

The decision of whether something may be removed is based on if it was marked experimental as of v1.0/GA or upon its introduction, in accordance with Documentation/versioning.md.
2019-07-11 14:05:18 -07:00
Menghan Li a90198c718
internal: seed random for wrr tests (#2791) 2019-04-26 14:47:55 -07:00
lyuxuan 5b263177f2
xds: make local proto generated files (#2750) 2019-04-16 13:35:16 -07:00
Easwar Swaminathan a9de79b9c3 Use 'go vet' and not 'go tool vet'. (#2768)
From [release notes](https://golang.org/doc/go1.12#vet):

The go vet command has been rewritten to serve as the
base for a range of different source code analysis tools. See
the golang.org/x/tools/go/analysis
package for details. A side-effect is that go tool vet
is no longer supported. External tools that use go tool vet must be
changed to use go vet. Using go vet instead of go tool vet should work
with all supported versions of Go.
2019-04-12 10:08:23 -07:00
Doug Fawley 3910b873d3
bar: add ability to update resolver state atomically and pass directly to the balancer (#2693) 2019-03-22 10:48:55 -07:00
Jean de Klerk 5878d965b2
transport: remove RequireHandshakeHybrid support (#2529)
This removes RequireHandshakeHybrid support and changes the default behavior
to RequireHandshakeOn. Dial calls will now block and wait for a successful
handshake before proceeding. Users relying on the old hybrid behavior (cmux
users) should consult https://github.com/soheilhy/cmux/issues/64.

Also, several tests have been updated to take this into consideration by
sending settings frames.
2019-02-27 11:04:46 -07:00
Doug Fawley d14ffaeb5c
client: deprecate CallCustomCodec and provide new version using encoding.Codec (#2556) 2019-02-01 10:21:31 -08:00
Doug Fawley 25e74d3f23
vet: use fail_on_output so user can see why git client is not porcelain (#2605) 2019-01-30 10:56:44 -08:00
Doug Fawley 9f93218b13
cleanup: update staticcheck to version supporting modules and new checkers (#2583) 2019-01-17 16:27:42 -08:00
Doug Fawley d7e8e3da0d
cleanup: remove staticcheck exception (#2582) 2019-01-17 10:24:42 -08:00
Jean de Klerk 253dfbcf7d
internal: use -go option to target 1.9 (#2550)
Staticcheck has a -go option which I _believe_ was recently added. This allows
us to pin to 1.9, preventing staticcheck from recommending we optimize to an
overly-recent version of Go.
2019-01-09 15:26:59 -08:00
Doug Fawley 0a391ff2b7
grpctest: add new package to manage tests and support per-test setup/teardown (#2523)
- Migrate `grpc` & `grpc/test` packages to use `Teardown` support to guarantee `leakcheck` is used
2019-01-07 14:24:56 -08:00
lyuxuan 5da252b6a6
health check test: prevent double close of hcEnterChan (#2441) 2018-12-13 16:44:36 -08:00
Doug Fawley f3eb5bc06e
client: add GRPC_GO_REQUIRE_HANDSHAKE options to control connection behavior (#2464)
Possible settings of this environment variable:

- "hybrid" (default; removed after the 1.17 release): do not wait for handshake before considering a connection ready, but wait before considering successful.

- "on" (default after the 1.17 release): wait for handshake before considering a connection ready/successful.

- "off": do not wait for handshake before considering a connection ready/successful.

This setting will be completely removed after the 1.18 release, and "on" will be the only supported behavior.
2018-11-26 15:06:46 -08:00
Doug Fawley 04ea82009c
cleanup: replace "x/net/context" import with "context" (#2439) 2018-11-12 13:30:41 -08:00
Jean de Klerk 6572a802a1
internal: update golint to use new url (#2393) 2018-10-31 14:39:18 -06:00
Doug Fawley 1b1c45ef21
internal: vet cleanups (#2405)
- Take advantage of `grep`'s status code, where possible
- Make the appengine check in vet.go exit with non-zero status if an error is encountered
- Add "fail_on_output" for the `tee|read` that we do when the status code cannot be used, to make it clear what it's for
- Document all our various checks
2018-10-26 15:50:46 -07:00
Menghan Li 425c07e59b internal: add check for import of ptypes proto packages (#2396) 2018-10-26 09:40:02 -07:00
Jean de Klerk 30212c8423 internal: fix various problems in transport_test.go
Commit 35c3afad17 added a `defer cancel()` line
to transport_test. While this line is generally good, there happens to be a
Go 1.6 bug that when a context that gets passed into Dial is canceled, it
has a 50% chance to incorrectly causes all future Dial writes to fail.

This commit removes that defer and adds a comment explaining the situation.

https://github.com/golang/go/issues/15078
https://github.com/golang/go/issues/15035

This commit also fixes a perceived (by the race detector) racy use of
server.conn by making conn.Close happen inside the goroutine that
uses conn.

This commit also fixes a SIGSEV caused by an incorrect typed nil
check.
2018-09-24 10:46:24 -07:00
lyuxuan bd04c06895
vet: move go_vet directory under test directory (#2310) 2018-09-17 15:03:21 -07:00
lyuxuan 46ee6abebf
import check for appengine environment(#2215) 2018-09-10 17:32:46 -07:00
dfawley ba4eb68a02
Travis/Makefile/vet cleanups (#2283)
- .travis.yml:
  - Download dependencies at install time
  - Run race and non-race in separate instances
  - Use braces around env var names
- vet.sh:
  - Run `go mod tidy` to keep it tidy
  - Stop filtering transport errors from go/vet output
  - Use braces around env var names
- Makefile:
  - Reorder alphabetically
  - Add "vetdeps" as a dependency of "vet"
  - Add "testappengine" to "all"
2018-09-04 15:10:01 -07:00
dfawley ce4f3c8a89
Initial go.mod module definition and corresponding Travis/vet.sh changes (#2281) 2018-08-31 12:58:30 -07:00
Menghan Li 59dd9b3f19
test: add go 1.11 to travis and remove go 1.7 (#2278) 2018-08-27 13:31:20 -07:00
dfawley 11b582728a
transport: move to internal to make room for new, public transport API (#2212)
This is a breaking change, but the transport package was never intended for use outside of grpc.  Any current users that we are aware of are incorrect or have a preferred alternative.
2018-07-11 11:22:45 -07:00
dfawley f3361fda2f
internal: changes to travis to make it do less work (#2200)
This PR removes race testing from all travis runs except go1.10 except during nightlies.

|                 | Before* | After** | % Change |
| --------------- | ------- | ------- | -------- |
| Total runtime   | 65m     | 45m     | -31%     |
| Wall-clock time | 21m     | 11.5m   | -45%     |

*: (one random sample I found in our PRs)
**: (latest run on this PR)

Also includes some organization changes (making proper use of `before_install` and `install`) / cleanups in `.travis.yml` to make it easier to understand.  As a result, we now stop unintentionally running `vet` on a second build by accident (go1.10 with retry enabled).
2018-07-06 11:09:40 -07:00
dfawley bd7f82c7b1
internal/grpcrand: New package for concurrency-safe randoms (#2106) 2018-05-29 09:06:35 -07:00
Jean de Klerk e9443916b5
internal: vet.sh quits when it sees macosx (#2048) 2018-05-02 16:47:25 -07:00
Menghan Li 66090d990b
vet: disallow importing "unsafe" (#2024) 2018-04-26 14:24:26 -07:00
Menghan Li 76b07ed73d
Mark old balancer and naming APIs as deprecated (#1951) 2018-04-05 13:12:31 -07:00
Menghan Li 47bddd7d06
vet: run golint on _string files (#1749)
We didn't run this because codes_string.go was generated by stringer. And we no longer use stringer.
2017-12-18 10:58:57 -08:00
Menghan Li b8191e57b2
remove stringer and go generate (#1715) 2017-12-06 17:35:20 -08:00
mmukhi ddbb27e545
client: backoff before reconnecting if an HTTP2 server preface was not received (#1648) 2017-12-01 09:55:42 -08:00
dfawley 816fa5b06f
Add proper support for 'identity' encoding type (#1664) 2017-11-17 09:24:54 -08:00
Menghan Li ebefec97dd
travis: fix GOARCH=386 and add misspell check (#1658)
- Define env variable RUN386 and set GOARCH later, instead of assigning to GOARCH directly. Otherwise, gimme will override GOARCH back
- Add misspell check
- Disable -race on 386
2017-11-08 13:40:05 -08:00
dfawley 08a4535419
vet.sh: don't check git status when doing -install (#1641) 2017-11-01 13:14:29 -07:00
Menghan Li 06233310cc Revert "Temporary disable staticcheck" (#1568) 2017-10-06 13:17:06 -07:00
dfawley c8405557a4 Remove Go1.6 support (#1492) 2017-10-04 13:57:10 -07:00
Menghan Li dc413bbc22 Temporary disable staticcheck (#1561) 2017-10-04 13:56:37 -07:00
dfawley 5a82377e69 transport: refactor of error/cancellation paths (#1533)
- The transport is now responsible for closing its own connection when an error
  occurs or when the context given to it in NewClientTransport() is canceled.

- Remove client/server shutdown channels -- add cancel function to allow
  self-cancellation.

- Plumb the clientConn's context into the client transport to allow for the
  transport to be canceled even after it has been removed from the ac (due to
  graceful close) when the ClientConn is closed.
2017-10-02 11:56:31 -07:00
dfawley 8afb9cb8f3 vet.sh: set PATH to force downloaded binaries to be run (#1529) 2017-09-20 11:19:09 -07:00
dfawley 91999f444f vet.sh: fix protoc installation (#1502) 2017-09-01 16:45:41 -07:00
dfawley d6870035ab Check "x/net/context" with `go vet` like "context" (#1490)
* Check "x/net/context" with `go vet` like "context"

Includes a signficant revamp of .travis.yml to execute a separate script for
all of the things we check before allowing a merge.

* fix bug in benchmain
2017-08-29 15:40:57 -07:00