Technically this is a behavior change, but any usage of "host:" or ":" should be considered invalid, since dialing a target with a trailing ":" attempts to dial port zero, which is never valid (and we always used to pass the target directly to `net.Dial`).
In https://github.com/grpc/grpc/pull/15618, the target format will be defined as: `host[:port]` -- not: `host[:[port]]`. (This is potentially subject to change.)
Fixes https://github.com/grpc/grpc-go/issues/2161
I introduced `serverTerminatedConnectionErr `, because I wanted `callRemoteBalancer` to still returns error on a terminated connections. Its client, which is function `watchRemoteBalancer` can decide how to log this error.
When remote grpclb-server terminates the connection, don't log it as
error. Instead, log it as info.
It is natural for servers to terminate long lived grpc streaming
connections. Two sample reasons to do this are: load balancing and
deployment of a new version. Therefore client of grpclb-server shouldn't
recognise this situation as an error.
fixes#2078
A status with invalid utf-8 characters could still be created, but invalid characters will be replaced with [Unicode replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) before being sent out. Those bytes will still be percent encoded.
All details added to this invalid status will be dropped.
fixes#2078
A status with invalid utf-8 characters could still be created, but invalid characters will be replaced with [Unicode replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character) before being sent out. Those bytes will still be percent encoded.
All details added to this invalid status will be dropped.
Reverts grpc/grpc-go#2098
Appengine will fail with the error below:
```
go-app-builder: Failed parsing input: parser: bad import "syscall" in google.golang.org/grpc/channelz/funcs.go from GOPATH
```
The root cause of it is in type_linux.go.
629f6bc5e5/channelz/types_linux.go (L21-L25)
This PR splits out grpclb from grpc. I have made the PR in several commits so you can see more clearly the steps that happened.
There are a few possibly contentious points that I would like to make clear up front:
* grpclb will no longer autoload as a load balancer. I think this is okay, as service config is not widely (at all?) used, and I believe this is the only way to access it.
* `internal` is used more, as a way of having code shared between packages without exposing types
* ConnectivityStateEvaluator, as used by grpclb, is no longer thread safe. I believe there is an outer mutex that guards access, but I want to point out this subtle change up here.
All but one tests pass with this, due to another cyclic dependency. I can fix this, but it is a little more widely scoped (such as exposing grpc.server and grpc.errorDesc in the internal package). This PR is a nearly-passing sample of that last step to get this working.
PTAL @menghanl @dfawley
Marshalling a Code to JSON and unmarshalling it failed with an
"invalid code" error message.
Code is of type uint32. It has no custom MarshalJson() implemented
therefore it is marshalled into an JSON integer value.
The UnmarshalJSON() function expected that the marshalled Code is a
String type, unmarshalling failed.
Check in UnmarshalJSON() if the value is an uint32 in the range of the
defined Code values. If it is, unmarshal it.
This commit also adds an Marshal/Unmarshal testcase.