aboutsummaryrefslogtreecommitdiff
path: root/netty
AgeCommit message (Collapse)Author
2020-07-27Merge "Add a build module for the Netty Shaded library"Hadrien Zalek
2020-07-24Add a build module for the Netty Shaded libraryHadrien Zalek
The gRPC documentation recommends that most users use the Netty Shaded library for Transport Layer Security (TLS) on non-Android platforms. The library prepackages netty-tcnative on BoringSSL which makes it easier to use. Note that this change essentially restores the module which was deleted in a previous commit. This new binary is imported for the same version that the source is currently at and does not cause any runtime issues. Test: m grpc-java-netty-shaded Bug: 148404241 Change-Id: I7ae611add53627d2c00beeeac829fa31069d5594
2020-06-29Remove gRPC Netty shaded static libraryHadrien Zalek
Remove the build module for the shaded library which causes issues at runtime due to missing symbols. This happens because the jar is prebuilt from an older version of gRPC and is no longer compatible with the current source. Additionally, the grpc-java module should not statically link against a specific transport jar that contains service providers. Doing so forces an automatically-loaded implementation on users. Test: m grpc-java Bug: 148404241 Change-Id: I77589c05756b55146648d726ea6e235f1887ac38
2018-10-19Add rules for grpc-javaJulien Desprez
Test: make grpc-java Bug: None Change-Id: Ibf9d369637f8cd780c42936c11b4bd67541f1a93
2018-10-18netty: fix local socket bindCarl Mastrangelo
2018-10-10core: add CallCredentials2 and deprecate CallCredentials' old interface (#4902)Kun Zhang
This is the first step of smoothly changing the CallCredentials API. Security level and authority are parameters required to be passed to applyRequestMetadata(). This change wraps them, along with MethodDescriptor and the transport attributes to RequestInfo, which is more clear to the implementers. ATTR_SECURITY_LEVEL is moved to the internal GrpcAttributes and annotated as TransportAttr, because transports are required to set it, but no user is actually reading them from {Client,Server}Call.getAttributes(). ATTR_AUTHORITY is removed, because no transport is overriding it. All involved interfaces are changed to abstract classes, as this will make further API changes smoother. The CallCredentials name is stabilized, thus we first introduce CallCredentials2, ask CallCredentials implementations to migrate to it, while GRPC accepting both at the same time, then replace CallCredentials with CallCredentials2.
2018-10-08netty: expose setting a local socket addressCarl Mastrangelo
2018-10-03core: add Grpc.TRANSPORT_ATTR_LOCAL_ADDR (#4906)Kun Zhang
Resolves #4135
2018-10-03netty: Add ProtocolNegotiator.closeEric Anderson
This notifies the negotiator when it will no longer be used, allowing it to clean up any resources.
2018-10-03netty: Remove TransportCreationParamsFilterFactoryEric Anderson
Now there is a clear lifetime of ProtocolNegotiator.
2018-09-24netty: Allow specifying ProtocolNegotatiorFactory directly to ChannelsEric Anderson
This will be the replacement for TransportCreationParamsFilterFactory and matches somewhat what used to be done and what is done on server-side.
2018-09-14all: use Java7 bracketsCarl Mastrangelo
2018-09-12netty: Initialize ProtocolNegotiators eagerlyEric Anderson
This simplifies the construction paradigm and leads to the eventual removal of TransportCreationParamsFilterFactory. The eventual end goal is to be able to shut down ProtocolNegotiators as is necessary for ALTS. The only reason the initialization was delayed was for 'authority', so we now plumb the authority through GrpcHttp2ConnectionHandler.
2018-09-11all: fix lint warnings in importZHANG Dapeng
2018-09-10netty,okhttp: Enable TransportTest.flowControlPushBackEric Anderson
It appears to be stable now. Ran for 1000s of times. I do see some general flakiness in TransportTest, but it applies to the tests in general and isn't specific to this one test. It is: ``` org.mockito.exceptions.verification.WantedButNotInvoked: Wanted but not invoked: listener.transportReady(); -> at io.grpc.internal.testing.AbstractTransportTest.startTransport(AbstractTransportTest.java:1815) Actually, there were zero interactions with this mock. ``` This flake is not seen often because it occurs less frequently when running all the tests (~.1% vs 1%). One of the early tests must warm something up to make it less likely.
2018-09-05all: prepend internal classes with Internal (#4826)zpencer
This is a safer way to hide the classes, because they will not appear in public targets for some build configurations.
2018-09-04all: move Channelz to io.grpc as InternalChannelz (#4797)zpencer
This is an API used to coordinate across packages and must live in `io.grpc`. Prepending `Internal` makes it easier to detect and hide this class from public visibility when using certain build tools. fixes #4796
2018-08-15alts: Use grpc-netty-shaded instead of grpc-nettyEric Anderson
There's no good way to provide users of ALTS a choice between grpc-netty and grpc-netty-shaded. Since Netty is not exposed through the ALTS API surface, we opt for the shaded version as it has fewer deployment issues. However, this also means that we _can't_ expose any Netty API, like EventLoopGroup.
2018-08-14netty/internal: add InternalNettyChannelBuilder.buildTransportFactory(). (#4757)Kun Zhang
This is needed internally for building netty transports outside of a channel.
2018-08-09netty: fix unused variable lintSpencer Fang
2018-07-30netty: Remove option to pass promise to WriteQueueEric Anderson
Passing a promise to WriteQueue was only misused to add a listener on the promise before issuing the write. Although in this case the listener ordering will be "random" because listeners are being added from two different threads, in general we always want to add a listener after the write returns to let any lower-level listeners be registered first. Future work can resolve the "random" listener order by passing the listener to the WriteQueue and adding the listener from the event loop.
2018-07-26Upgrade Shadow and Animalsniffer pluginsEric Anderson
This avoids warnings of Gradle 5 deprecation.
2018-07-10netty: Fix regression in Java 9 ALPN supportEric Anderson
Enable testing on Java 9+ in TlsTest, to prevent future regressions. Fixes #4620
2018-07-09netty: Propagate EAG attributes to ProtocolNegotiatorEric Anderson
This lets the NameResolver/LB coordinate with the negotiator, like is necessary with ALTS on GCP.
2018-07-09Propagate EquivalentAddressGroup attributes to transportsEric Anderson
Most of the changes are changing the signature of newClientTransport. Since this is annoying, I choose to introduce a ClientTransportOptions object to avoid the churn in the future. With ClientTransportOptions in place, there's only a few lines necessary of plumbing for the Attributes: add the field to ClientTransportOptions and populate it in InternalSubchannel. There are no consumers of the field in this commit.
2018-07-04Fix unused variablesEric Anderson
Unused variables in tests were deleted. The unused variable in Netty was a future that needed completing; that was a bug.
2018-06-28netty,okhttp: make rpc followed by racy GOAWAY transparent-retry-ableZHANG Dapeng
A new RPC starts with the following steps: 1. Pick a READY transport 2. the READY transport calls `transport.newStream()` 3. the new stream calls `stream.start()` 4. `stream.start()` invokes or enqueus `writeHeaders()` (or for GET request, noop) A racy GOAWAY could happen between 3 and 4, and by the retry spec, the RPC should be transparent-retry-able in this case. For Netty and OkHttp transport implementation, before step 4, (even if step 1, 2, and 3 excluding 4 are made atomic,) the http2-stream for the RPC is not created, so the current transparent retry logic does not apply and need fix. Of course, if step 1, 2, and 3 including 4 are made atomic, and not with GET, there will be no such problem.
2018-06-11all: add gradle format checkerZHANG Dapeng
This PR adds an automatic gradle format checker and reformats all the *.gradle files. After this, new changes to *.gradle files will fail to build if not in good format, just like checkStyle failure.
2018-05-24Propagate CallCredentials.ATTR_SECURITY_LEVEL from transportsEric Anderson
Previously no transport provided the key so CallCredentials would always see the security as NONE.
2018-05-23noop: resolve lint warnings found at import. (#4496)Kun Zhang
2018-05-21all: TimeProvider to use nanos rather than millisZHANG Dapeng
This is the same practice as #2833
2018-05-17netty: Fix Javadoc reference to Channelz.SecurityEric Anderson
This fixes the warning: `Tag @link: reference not found: Channelz.Security` Javadoc `@link` is simplistic in its processing of '.' and thinks if a dot exists it means it is part of the package name. You're forced to use the full name of nested classes.
2018-05-15context/core/netty: Add @CheckReturnValue to ContextZHANG Dapeng
By adding inner class annotations without introducing external dependencies.
2018-05-07core,netty,okhttp: make toString more consistent for channelz (#4434)zpencer
Use MoreObjects.toStringHelper and use only the log id's long value, because the class name is already present in the toStringHelper.
2018-05-03 all: normalize copyright header Carl Mastrangelo
2018-04-27(low priority) core,netty,interop-testing: stabilize maxInboundMessageSize ↵zpencer
API (#4399) On server side, `maxMessageSize` is deprecated for `maxInboundMessageSize` to match the channel builder. Update usages to use new setter.
2018-04-25core,netty,okhttp,services,testing: expose security info to channelz (#4300)zpencer
Pull the TLS info from the SSLSession object for TLS, and AltsContext for ALTS.
2018-04-13netty: fix visibility issues with InternalNettySocketSupport (#4335)zpencer
Previous version is not actually extendable from other packages.
2018-04-13all: add toString() to Server to improve debug infoZHANG Dapeng
2018-04-11netty: prepare NettySocketSupport for internal import (#4311)zpencer
Delegate the actual heavy lifting to a helper class that can be easily swapped at runtime.
2018-04-11core, netty: allow InputStream based certs (#4316)zpencer
Allow ServerBuilder to read certs from InputStream, not just from a File.
2018-04-05core,netty: add NettySocketSupport to populate TcpInfo (#4306)zpencer
NettySocketSupport is responsible for making the low level calls to get and populate the TcpInfo structure.
2018-04-04netty: fix getListenSockets race (#4301)zpencer
Move registration to separate future and wait for it.
2018-04-04netty,services: fix param comment lint (#4304)zpencer
Fix linter complaint because comment does not match arg name.
2018-04-03core,services: binary log should use real peer socket and call id (#4266)zpencer
The peer socket is read from TRANSPORT_ATTR_REMOTE_ADDR from the stream attributes. We only log the peer on receive initial metadata. The call id assumes census is available. The call ID read from the context via SERVER_CALL_ID_CONTEXT_KEY on server side, and read from CallOptions via CLIENT_CALL_ID_CALLOPTION_KEY on client side. The value is copied from CONTEXT_SPAN_KEY which is set by census. Pass around CallId with two longs, not a byte[].
2018-04-03core,netty,services: add server listen sockets to channelz proto service (#4220)zpencer
Server listen sockets differ from normal sockets in that they do not have a remote address, do not have stats on calls started/failed/etc, and do not have security info.
2018-03-30core,netty,okhttp,services: expose socket options to channelz (#4228)zpencer
For okhttp, expose the standard options from the Socket object. For netty, expose all the `io.netty.channel.ChannelOption`s of the `channel.config()`.
2018-03-28netty: http2 server transport graceful shutdown sends 2 GOAWAYsZHANG Dapeng
resolves #3442
2018-03-23netty,okhttp,testing: always set TRANSPORT_ATTR_REMOTE_ADDR (#4217)zpencer
Always set the remote address, no reason why this should be a TLS-only feature. This is needed for channelz, and is especially useful in unit tests where we are using plaintext. This PR adds the attr for plaintext.
2018-03-23netty: Add support for ConscryptEric Anderson