Commit Graph

2571 Commits

Author SHA1 Message Date
Eric Anderson 3002a23a0f Lint fixes 2018-02-28 10:20:08 -08:00
Carl Mastrangelo 7af2373a03
core,netty,okhttp,alts,inprocess: deprecate usePlaintext(boolean) 2018-02-28 08:53:14 -08:00
Eric Anderson 1b5aadf068 core: Disable panic mode
It is now discovering legitimate errors in some tests that need to be
resolved first. Follow progress at #3293.
2018-02-27 14:03:34 -08:00
zpencer 09d305c3fc
core: add server transports to channelz (#4149)
A previous PR added client transports, this PR adds server
transports.
2018-02-27 10:02:44 -08:00
zpencer 4dc1b50e1a
core: add ServerImpl to channelz (#4147)
This allows servers to be identified by ids.
2018-02-27 08:22:25 -08:00
ZHANG Dapeng 39decadaf6
core: allow application to provide all threads - inprocess channel 2018-02-26 17:12:04 -08:00
zpencer 00d1805f78
core: register client transports to channelz (#4146)
This makes client side transports visible to channelz when created,
and removed when terminated.
2018-02-26 16:41:09 -08:00
Eric Anderson 25f851bf5a alts: Remove Java 8 library usages (#4143) 2018-02-26 15:11:13 -08:00
Eric Anderson ce84c2b227 core: Add missing @RunWith test annotation (#4142)
For ManagedChannelOrphanWrapperTest
2018-02-26 14:06:43 -08:00
zpencer b71b1084de
core: register channels, subchannels, oobchannels with channelz (#4035)
Channels, subchannels and oobchannels are added at creation and
removed at termination. Same goes for subchannels and
oobchannels. Everything is registered as a hard reference. This means
channels that are not properly cleaned up using `awaitTermination`
will remain visible in channelz.
2018-02-26 09:45:19 -08:00
ZHANG Dapeng 4bac7d7084
core: add InProcessServerBuilder.generateName() 2018-02-23 16:44:10 -08:00
Jiangtao Li af2ae2a1e0
alts: re-order dependencies in ALTS bazel build (#4133) 2018-02-23 15:59:54 -08:00
Eric Anderson 9f677a991a buildscripts: Hard-code use of TLSv1.2 for github download
GitHub is now requiring TLS v1.2:
https://githubengineering.com/crypto-removal-notice/

Without this configuration, we see:
iwr : The request was aborted: Could not create SSL/TLS secure channel.
At line:1 char:5
+ & { iwr https://github.com/google/protobuf/archive/v3.5.1.zip -OutFile
protobuf. ...
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:Htt
  pWebRequest) [Invoke-WebRequest], WebException
   + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
  ll.Commands.InvokeWebRequestCommand

Fixes #4120
2018-02-23 13:34:12 -08:00
Jiangtao Li d8630f2521 alts: add ALTS to interop tests 2018-02-23 12:44:18 -08:00
Shohei Kamimori 21541243f8 alts: change visibility of `NettyServerBuilder` (#4088) 2018-02-22 14:32:46 -08:00
Carmi Grushko 2db5e0dc35 all: rename Bazel workspace to io_grpc_grpc_java
Fixes #4095
2018-02-22 13:59:45 -08:00
Carl Mastrangelo 713ac0a886
all: update to latest alpn agent 2018-02-22 13:32:05 -08:00
Carl Mastrangelo 6d51cb4aef
netty: bump to 4.1.22-Final 2018-02-22 13:10:04 -08:00
ZHANG Dapeng e31851a0eb
core: remove runDunTasks with filter
In `FakeClock` we have `runDueTasks()` (without filter), `numPendingTasks(filter)`, and `getPendingTasks(filter)` which are useful. The `runDueTasks(filter)` method seems not a right way to test.
2018-02-22 12:46:24 -08:00
Eric Gribkoff d4b11e5659
examples: include correct version in Android caching example (#4114) 2018-02-22 12:16:19 -08:00
zpencer 9dc4ded597
core: move ManagedChannelImpl orphan check to wrapper class (#4093)
okhttp and netty libraries will retain hard references to
ManagedChannelImpl via its non static nested classes. Moving the
orphan check to a wrapper class solves this problem.

- Added ForwardingManagedChannel + test
2018-02-22 11:57:26 -08:00
Rama Chavali 48ca4527c1 core: change serverimpl,servercallimpl's internalclose to cancel stream (#4038)
The HTTP/2 error code will be INTERNAL_ERROR for all cancel statuses,
except for DEADLINE_EXCEEDED and CANCELLED, which are mapped to
CANCELLED.
2018-02-22 11:09:21 -08:00
zpencer 887217e57b
core,services: fix binarylog unit tests (#4109)
- The unsafe operation was reverted in code, so the test should not
  use it either
- The variable naming is tripping internal linters
2018-02-22 10:08:12 -08:00
Kun Zhang 46c1133a1e
core: add panic mode for ManagedChannelImpl (#4023)
Channel enters this mode whenever there is an uncaught throwable from
its ChannelExecutor, which is where most channel internal states are
mutated, such as load-balancing.

In panic mode, the channel will always report TRANSIENT_FAILURE as its
state, and will fail RPCs with an INTERNAL error code with the
uncaught throwable as the cause, which is helpful for investigating
bugs within gRPC and 3rd-party LoadBalancer implementations.

## Change to existing behavior
Previously if `LoadBalancer` throws in `handleResolvedAddressGroups()`, it would
be routed back to `LoadBalancer.handleNameResolutionError()`. Now it will make
the channel panic.

## Internal refactors
- Refactored out `shutdownNameResolverAndLoadBalancer()`, called from three code paths: `enterIdleMode()`, `delayedTransport.transportTerminated()`, and `panic()`.
- Refactored out `updateSubchannelPicker()`, called from both `updateBalancingState()` and `panic()`.
2018-02-22 09:27:08 -08:00
Carmi Grushko 137c74d15f Drop @grpc_java from labels
These don't contribute if grpc-java is imported with name = grpc_java,
and break the build if grpc-java is imported with another name.
2018-02-21 15:14:17 -08:00
ZHANG Dapeng 38c84ed9ef
core: temporarily disable retry when stats or tracing is enabled
To avoid breakage, temporarily disable retry when stats or tracing is enabled.

This still agrees with the description of the javadoc of `ManagedChannelBuilder.enableRetry()`

```java
/**
   * Enables the retry mechanism provided by the gRPC library.
   *
   * <p>This method may not work as expected for the current release because retry is not fully
   * implemented yet.
   *
   * @return this
   * @since 1.11.0
   */
  @ExperimentalApi("https://github.com/grpc/grpc-java/issues/3982")
  public T enableRetry()
```
2018-02-21 15:04:36 -08:00
Eric Anderson b78c5cfcf2 core: Improve status descriptions in MessageDeframer
This removes the debug string added in 5a4794f2c because the issue was resolved
and the debug string is confusing for Netty, producing results like:
io.grpc.netty.NettyClientTransport$3: Frame size 216695976 exceeds maximum: 4194304

This makes it seem like it's a HTTP/2 frame problem and not a gRPC message
problem. Although it is clearer once you see the maximum is 4 MB, this already
bit me in #4086.

In general, we should talk about "messages" instead of "frames" when possible
as that's what is most comprehensible to the consumer of the description. I
also make sure to mention "gRPC" messages/frames because otherwise the message
is ambiguous.
2018-02-21 14:20:12 -08:00
zpencer 7d47ac0c12
core: Clarify ownership of InputStreams wrt Marshaller and Stream (#3419)
It is the responsibility of the caller to close the `InputStream`
returned by `Marshaller`.

`Stream` takes ownership of any `InputStream`s passed in.

`DelayedStream` and the streams of `InProcessTransport` already
handle ownership transfer, but `AbstractStream` needs to call
`close`.
2018-02-20 09:57:57 -08:00
zpencer 5f7b64a250
core,services: lock down visibility of BinaryLogSink (#4100)
- This class should not be a part of the public API
- Update ServiceProvidersTest to verify package private services can be
  loaded with the utility.
2018-02-20 09:54:40 -08:00
zpencer bde2ba2444
services: introduce BinaryLogSinkProvider (#3917)
The `BinaryLog` will write `GrpcLogEntry`s to the sink, which is
intended as a pluggable interface. It is the sink's
responsibility to send the binlog protos to disk, to a remote
logging service, etc.
2018-02-16 13:47:31 -08:00
Eric Gribkoff 0c27e719ae
Update README to reference 1.10.0 (#4090) 2018-02-15 18:54:38 -08:00
Carl Mastrangelo a414b91a59
context: remove context profiling 2018-02-15 18:08:19 -08:00
ZHANG Dapeng df4048d98d
core: retry part 5 continued, throttle policy 2018-02-15 13:15:04 -08:00
Jiangtao Li e7f2f1dedd alts: add gRPC ALTS 2018-02-15 09:28:00 -08:00
zpencer a45d07bcb5
build: run unit tests on osx, ensure proto output included (#4081)
This adds back functionality that was accidentally dropped when
porting from travis:
- make sure generating protos will not lead to any uncomitted changes
- actually run the unit tests
2018-02-14 16:44:02 -08:00
Eric Anderson 8c51683af1 SECURITY.md: Mention netty-handler instead of codec-http2
netty-handler has SslHandler which is really the piece that needs to
agree with netty-tcnative. But as I mention, all of netty should be a
consistent version, otherwise it may randomly break due to internal API
changes.
2018-02-14 14:52:04 -08:00
Eric Gribkoff 79bf7de927
examples: match applicationId to AndroidManifest.xml package (#4075) 2018-02-14 14:43:16 -08:00
Carl Mastrangelo 2f2881756f
core: remove lint warning 2018-02-14 13:10:55 -08:00
zpencer fbc079d631
buildscripts: build macos artifacts in kokoro (#4066) 2018-02-14 12:53:11 -08:00
zpencer 8925921805
buildscripts: avoid remote repo vars in uploadArchives for local (#4076) 2018-02-13 11:17:53 -08:00
Eric Anderson 3480a08e70 core: ConnectivityStateManager is always enabled
There have been no callers of disable() since commit 1c7421be7.
2018-02-13 08:56:43 -08:00
Carl Mastrangelo 35665af72c
netty: upgrade to 4.1.21 2018-02-12 17:42:11 -08:00
Eric Anderson a888d46b93 netty: Include more details for closure of unknown reason
Some users have reported "Channel closed but for unknown reason".
Adding this information doesn't tell us where the bug is, but may help
us narrow down why getShutdownStatus() is null.
2018-02-12 16:49:22 -08:00
zpencer 890da706bb
Revert "core: tests for forwarding {Server,Client}{Call, CallListener} (#4058)" (#4070)
This reverts commit 77397b9dd0.
2018-02-12 12:21:24 -08:00
Carl Mastrangelo 6c437b2998
netty: upstream unit conversion 2018-02-12 11:11:11 -08:00
Eric Anderson f48a5097ef kokoro: Avoid getting cmake if it's installed
Kokoro already has cmake installed, so it's not necessary in that
environment. We still keep the old code around because it's helpful for
setting up new Windows environments in general.
2018-02-12 07:22:36 -08:00
Carl Mastrangelo 6ea8fffa2b
context: add basic context profiling 2018-02-09 19:45:19 -08:00
Eric Gribkoff 6ee6eae5a0
core: add prepareToLoseNetwork() method to ManagedChannel 2018-02-09 11:05:09 -08:00
zpencer 77397b9dd0
core: tests for forwarding {Server,Client}{Call, CallListener} (#4058) 2018-02-09 10:56:39 -08:00
zpencer 5d5e8c6ad5
core: Install the ServerInterceptor from BinaryLogProvider (#3879) 2018-02-09 10:56:04 -08:00