Commit Graph

519 Commits

Author SHA1 Message Date
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
Carl Mastrangelo 6c437b2998
netty: upstream unit conversion 2018-02-12 11:11:11 -08:00
zpencer f8c7f963ef
core,netty,okhttp: use ServiceProviders for ManagedChannelProvider, ServerProvider (#4047) 2018-02-08 08:57:52 -08:00
Eric Anderson f1bc4493b8 netty: Add test to verify error for TLS failure
This is to notice regressions like in #4016
2018-02-01 12:30:18 -08:00
Eric Anderson c56114ff79 netty/shaded: Bump shadow plugin version to 2.0.2
This fixes the gradle warning:
The SimpleWorkResult type has been deprecated and is scheduled to be
removed in Gradle 5.0. Please use WorkResults.didWork() instead.
2018-02-01 09:58:23 -08:00
zpencer 199a5203c5
core: move ChannelStats and TransportStats to io.grpc.internal.Channelz (#4008) 2018-01-25 23:24:49 -08:00
zpencer b109595ad3
core: move Instrumented, LogId, WithLogId to io.grpc.internal as public (#3995) 2018-01-25 17:19:00 -08:00
Carl Mastrangelo 417765b814
netty: only add gRPC negotiator once SSL is established 2018-01-25 11:51:24 -08:00
Shohei Kamimori b5ae13405f netty: avoid unintentionally NullPointerException (#3932) 2018-01-17 15:47:45 -08:00
Carl Mastrangelo a3d801d07d
netty: make GrpcHttp2ConnectionHandler able to indicate it will no longer be used
This adds a method on GrpcHttp2ConnectionHandler which, when called, indicates that the channel associated with the handler is no longer needed.   

Notes:

* The handler may not be on the channel, but will either need to be added or will never be added.
* The channel will only be "unused" on the server side.
* It is expected that after calling `notifyUnused()`, the channel will be deregistered from the loop without being properly shut down.   This allows the channel to be handed off to a Non-netty API.
2018-01-11 14:12:12 -08:00
Eric Anderson ba8063e7b0 all: Prefer mock+delegatesTo() over Mockito.spy()
Spies are really magical and easily produce unexpected results. Using them in
tests can easily yield tests that don't do what you think they do. Delegation
is much safer when possible.

Delegation doesn't work when methods `return true`, final methods, and with
restricted visibility, though. So CensusModulesTest and
MaxConnectionIdleManagerTest are left as-is.
2018-01-11 09:32:54 -08:00
Eric Anderson 4bc0c95d0b Update ErrorProne to 2.1.3 and fix failures
The fixes could have subtle side-effects, but I did take care when making them.
2018-01-09 12:40:55 -08:00
Eric Anderson 35a6bf863d Enable the Guava Beta Checker 2018-01-08 14:52:51 -08:00
Teo Jia Jiun 3e76bf143b netty: Use Java 9 ALPN if available 2017-12-21 14:26:09 -08:00
zpencer f1151f91b9
core: InternalInstrumented<T> for instrumented classes (#3817)
Entities that report stats to channelz will implement this interface.
2017-12-13 12:56:25 -08:00
Eric Anderson 83d710b6d7 Shade Netty transport, with tcnative
The entire transport is shaded because we wouldn't want to collide with
the unshaded form of grpc-netty.
2017-12-08 14:02:35 -08:00
zpencer 359e61eb4a
netty: NettyServerTest should not hard code ports (#3845) 2017-12-07 10:53:28 -08:00
Shohei Kamimori 8b716a2f18 netty: add test for NettyServerBuilder 2017-12-07 09:07:31 -08:00
Carl Mastrangelo c9b02db276
all: add Status messages to all statuses 2017-12-04 19:00:16 -08:00
zpencer 9e7a4c44be
core: move WithLog and LogId to io.grpc (#3813)
The channelz service must not live in io.grpc.internal, and channelz
needs to be able to get the identifier of the entities it
tracks. Since io.grpc can not refer to io.grpc.internal, the LogId
must be moved out of internal.
2017-11-30 15:04:40 -08:00
zpencer 25cd0be24c
core,netty,okhttp: move TransportTracer.Stats to io.grpc (#3812)
io.grpc can not refer to io.grpc.internal so this needs to be moved
out.
2017-11-30 13:01:58 -08:00
Xiaoshuang LU cdb1f54794 netty: make server sockets be configurable 2017-11-22 16:00:33 -08:00
Eric Anderson 9bdb8f005a netty: Include more stace trace information for ClosedChannelExceptions
There's been another sighting, but it's very hard to narrow down what is
triggering it.
2017-11-17 13:18:52 -08:00
zpencer 2f155606b8
core,netty: add ID to NettyServer (#3745)
These are already WithLogId:
 ManagedChannelImpl, InternalSubchannel, ServerTransport
2017-11-15 11:49:13 -08:00
ramaraochavali df357cb8d3 netty: Netty server poorly handles unknown content type 2017-11-15 11:32:50 -08:00
ZHANG Dapeng 66f9ef5d69
netty: fix server keepalive unexpected ping ack
Resolves #3684
2017-11-14 11:09:31 -08:00
Kun Zhang de06a9471a
core: add internal accessors to control stats recording of RPC upstarts. (#3736) 2017-11-14 11:00:20 -08:00
zpencer 47bee4feee
core,netty: plumb fake clock into transport tracer tests (#3724) 2017-11-13 15:58:29 -08:00
zpencer d0a84ae5b8
core,netty: wire TransportTracer to netty client (#3705) 2017-11-10 15:55:21 -08:00
Eric Anderson b026ea544c netty: Avoid clearing SSLParameters
Since Netty may have set some parameters already, we should modify the
existing SSLParameters instead of starting from scratch.

This may fix ALPN with JDK9, but full support for ALPN with JDK9 is
still later work and we're not supporting it yet.

Fixes #3532
2017-11-10 13:08:58 -08:00
ramaraochavali 17e1ad9bb2 core: Add useTransportSecurity to ManagedChannelBuilder
This allows the consumer of a builder to swap back from plaintext.
2017-11-10 10:57:05 -08:00
Eric Anderson 93e89ba704 netty: Move server transportReady after client preface receipt
This mirrors the behavior of client-side.
2017-11-10 10:42:29 -08:00
zpencer 9ae5f116b5
netty: TransportTracer test for local window update (#3710) 2017-11-09 17:13:04 -08:00
zpencer af4cd2ebfd
netty: bump correct value of outbound msg counter (#3667)
No need for SendFrameGrpcCommand to know about the message count.
2017-11-09 11:32:19 -08:00
Eric Anderson bbb98feb75 Fix broken method names in tests that include leading '/'
The method name passed to MethodDescriptor does not include the leading
'/'. If it does, on the wire it will actually cause two slashes. This
has been this way for a _long_ time, but in tests that ignore the method
name or use the same MethodDescriptor no client and server the extra /
"works fine." But it's misleading, so let's remove it.
2017-11-08 15:24:50 -08:00
zpencer f2968f518f
core,netty: correctly count streams that ended due to client cancel (#3683)
Only bump the counter from AbstractServerStream.TransportState, and hole punch
from AbstractServerStream to TransportState when the application calls close.
2017-11-08 13:18:12 -08:00
zpencer a3c44fa7ca
core,netty,okhttp: add TransportTracer param to ClientStream and Http2ClientStreamTransportState (#3668)
This diff does not actually change any behaviors yet, that will come
in the next diff along with unit tests for those new behaviors. This
diff's goal is only to change the method signatures so future diffs
are cleaner.
2017-11-07 16:08:55 -08:00
zpencer a2e9a7f6dd
core,ntety,okhttp: Add getTransportStats method to ClientTransport (#3662)
This merely adds the method but does not do anything yet.
2017-11-06 13:24:20 -08:00
zpencer 9fac15d4f8
core,netty,okhttp: move transport tracer outbound counters to transport thread (#3661)
Counters are bumped when a message is completely written. If a
part of a message is still buffered and not yet flushed, we will
not increment the stats.
2017-11-06 12:46:17 -08:00
zpencer 2162cd07d5
netty,core: add a TransportTracer class (#3454) 2017-11-02 15:44:21 -07:00
Ray Tsang 80a8c8f3d7 netty: Updated ALPN error message and added troubleshooting procedures 2017-11-01 13:01:43 -07:00
Carl Mastrangelo 8f88cb82f2
netty: include rst stream message in Status 2017-10-31 10:49:25 -07:00
zpencer 5856a932c3
netty: separate connection log (#3591)
Move netty connection log info to a separate logger:
  io.grpc.netty.NettyServerTransport.connections

Users can redirect or disable this log using the usual way:
  -Djava.util.logging.config.file="logging.properties"
2017-10-27 13:15:49 -07:00
zpencer 7df9ae9753 core,netty,okhttp: detect proxy via ProxySelector (#3021)
This lets us specify the proxy using `-Dhttps.proxyHost=host -Dhttps.proxyPort=port`
along with auth info like username and password.
2017-10-17 19:26:11 -07:00
Kun Zhang 8edead0851 core: make in-process transport support StreamTracer
This is needed for both completeness and stats/tracing contexts propagation.

Stats recording with Census is intentionally disabled (#2284), while the rest of the Census-related logic work the same as on the other transports.
2017-10-09 10:14:36 -07:00
Carl Mastrangelo 5e36a8deb5 all: upgrade to JUnit 4.12 2017-10-05 11:24:15 -07:00
Eric Anderson e92b72588d Promote keepalive to ManagedChannelBuilder; stabilize
Fixes #3493
2017-09-27 11:59:04 -07:00
Carl Mastrangelo 80334d5b2f netty: update to 4.1.16 2017-09-25 18:18:17 -07:00
Eric Gribkoff 5ac9ad0c1f core: client supports inbound gzipped streams (#3403) 2017-09-25 09:01:53 -07:00