Commit Graph

1818 Commits

Author SHA1 Message Date
Eric Anderson 7b26a3249c docs: Add gradle build to steps in RELEASING 2016-07-07 16:11:36 -07:00
Eric Anderson 554287a0cd docs: Add missing files to sed in RELEASING 2016-07-07 16:11:36 -07:00
Eric Anderson 16b096b571 Reduce default max message size to 4 MiB
Fixes #1676
2016-07-07 13:34:53 -07:00
Jakob Buchgraber 2d7347fbfc netty: undo commit 6a55e29 as netty's DefaultThreadFactory has been fixed 2016-07-02 13:23:41 +02:00
Jakob Buchgraber 1257f96a00 netty: reduce allocations in write queue.
- Merge all the command objects with QueuedCommand so to save one object allocation per write.
- Add unit tests
2016-07-02 12:17:54 +02:00
Carl Mastrangelo 9bbaa8f46b interop tests: fix race in Compression tests where MetadataEntry.getParsed was being concurrently called.
Metadata is internally not thread safe, so putting it in a volatile is not enough.
2016-07-01 16:42:05 -07:00
Carl Mastrangelo 8d9283116c core: add @GaurdedBy annotations for mutable state of ServerImpl
Commit 5487ea8f54 unintentionally fixed a race condition in

shutdownNow, but the race was detected when being used inside Google.  This could have
been avoided by the enforceable documentation of GaurdedBy annotations.  These make it
clear what locks should be held, promote documentation for newly added server state,
and can be automatically checked by static analysis.
2016-07-01 16:11:20 -07:00
Carl Mastrangelo 2292cbfca0 netty: prevent race between transportCreated and transportShutdown 2016-07-01 15:57:47 -07:00
Eric Anderson 46379da1a6 Start 1.0.0 development cycle 2016-07-01 11:46:33 -07:00
Eric Anderson 75f27ba625 examples: Avoid deprecated generated class 2016-07-01 11:21:48 -07:00
Eric Anderson 32fd329e1c core: Rename withCredentials to withCallCredentials on CallOptions
It was withCallCredentials on the stub to avoid confusion with channel
credentials (which don't exist in Java at this time, but do in other
languages), and having the method names be different doesn't add value.
2016-07-01 11:18:38 -07:00
nmittler 8f78b4d88e Fixing error-prone warnings. 2016-07-01 10:03:41 -07:00
Jakob Buchgraber 3eafa5aeec benchmarks: fix typo in README 2016-07-01 16:20:47 +02:00
Eric Anderson 31651f369f auth: Promote OAuth2 service accounts to JWT
JWT needs less configuration and zero round-trips to initialize.

Fixes #785
2016-06-30 15:41:39 -07:00
Jakob Buchgraber c5733742ce netty: fix incorrect usage of AsciString.
An AsciiString object may only use a subsection of its backing byte array. We need to test for this and return a copy of the subsection if necessary.
Big thanks to @normanmaurer for uncovering this issue: https://github.com/netty/netty/issues/5472
2016-06-30 16:28:45 +02:00
ZHANG Dapeng f149e4c175 compiler: deprecate interfaces and add ImplBase in codegen
first step to address issue #1469:

- leave and deprecate interfaces in codegen
- introduce `ServiceImplBase`,
- `AbstractService` is deprecated and extends `ServiceImplBase`
- static `bindService()` is deprecated
2016-06-29 21:17:03 -07:00
Carl Mastrangelo dc027ff346 examples: add an example showing how to get the error details from a call
Fixes #1295
2016-06-28 16:10:38 -07:00
David Cao 4b17a2e317 Android hello world example is now using proto lite. 2016-06-28 14:34:00 -07:00
ZHANG Dapeng 8ed2dc8bec testware: fix flakes caused by pickUnusedPort
Resolves #1756

The thread-unsafe method `io.grpc.testing.TestUtils.pickUnusedPort` causes flakes (#1756) in windows. Need to avoid use of this method in test as in windows the tests are running in different jvms and concurrent calls of this method in multiple processes tend to return the same port number.

There are some usages of this method in benchmarks, so moved the method to `io.grpc.benchmarks.Utils` and the method will only be used in benchmarks and not in test.
2016-06-28 13:34:38 -07:00
Eric Anderson dbef1af29a Bump protobuf dependency to 3.0.0-beta-3
This allows us to play with zero-copy and proto3 support for lite.
Unfortunately, it introduced some warnings, so deprecated warnings are
now ignored for benchmarks and interop-testing.
2016-06-28 08:58:13 -07:00
Eric Anderson fe5b7e3e9b core: Improve error message when lacking NameResolverProviders
This is to improve debugging as in #1982.
2016-06-27 15:21:17 -07:00
Eric Anderson 29776ca947 core: Fix onReady race by adding DelayedStreamListener
onReady/isReady previously could disagree causing a sort of deadlock
where the application isn't sending because grpc said not to, but won't
be informed to send via onReady later.

This is a stack trace from inprocessTransportOutboundFlowControl. The
line numbers are from this commit but with the changes to DelayedStream
disabled:

at io.grpc.internal.DelayedStream.isReady(DelayedStream.java:306)
  (That is isReady returning false because fallThrough == false)
at io.grpc.internal.ClientCallImpl.isReady(ClientCallImpl.java:382)
at io.grpc.stub.ClientCalls$CallToStreamObserverAdapter.isReady(ClientCalls.java:289)
at io.grpc.stub.ClientCallsTest$8$1.run(ClientCallsTest.java:403)
  (And yet that was the onReady callback, and it won't be called again)
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onReady(ClientCalls.java:377)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$4.runInContext(ClientCallImpl.java:481)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
at io.grpc.internal.SerializeReentrantCallsDirectExecutor.execute(SerializeReentrantCallsDirectExecutor.java:65)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.onReady(ClientCallImpl.java:478)
at io.grpc.internal.DelayedStream$DelayedStreamListener.onReady(DelayedStream.java:366)
at io.grpc.inprocess.InProcessTransport$InProcessStream$InProcessServerStream.request(InProcessTransport.java:284)
at io.grpc.internal.ServerCallImpl.request(ServerCallImpl.java:99)
at io.grpc.stub.ServerCalls$ServerCallStreamObserverImpl.request(ServerCalls.java:345)
at io.grpc.stub.ClientCallsTest.inprocessTransportOutboundFlowControl(ClientCallsTest.java:432)

Fixes #1932
2016-06-27 13:35:52 -07:00
William Thurston 88a0378912 core: Add a RoundRobin LoadBalancer. 2016-06-27 09:56:26 -07:00
Carl Mastrangelo b55a2bfb3f core: clarify StreamObserver documentation
Fixes #986
2016-06-27 08:20:21 -07:00
Jakob Buchgraber fc5197fbf4 netty: detect when ALPN was not used. Fixes #522 2016-06-25 15:59:30 +02:00
Carl Mastrangelo 46f418da94 core: fix race with exception in onMessage
Fixes #1652
2016-06-24 16:25:55 -07:00
Carl Mastrangelo 6c59770a5b core: update issue for Contexts experimental status 2016-06-24 15:45:06 -07:00
Eric Anderson 5487ea8f54 Remove unused variables
This fixed a threading issue in ServerImpl because the unused variable
should have been used.
2016-06-24 12:11:03 -07:00
Carl Mastrangelo e11917e1b8 core: add package level javadoc.
Fixes #714
2016-06-24 10:48:27 -07:00
Carl Mastrangelo a10712b515 examples: move json server and client to advanced package
Fixes: #1778 (again)
2016-06-24 10:40:02 -07:00
Carl Mastrangelo 6f2c1ea078 core: mark Context as not experimental
Updates #1705
2016-06-23 13:18:56 -07:00
Kun Zhang adbc3f7ab9 doc: add flow-control example to ClientCall javadoc.
Resolves #1479
2016-06-23 10:57:18 -07:00
Eric Anderson 23f34be649 core: Move ServerMethodDefinition back into top-level class
This effectively reverts part of 3df1446d.
2016-06-23 09:31:46 -07:00
Eric Anderson cd9042b49b core: Harden ServiceDescriptor API
Over-specifying List prevents fewer things to be passed in and makes it
less efficient to use a Map later. We definitely don't want people
extending this class.
2016-06-23 09:31:46 -07:00
Eric Anderson bf588b0be8 core: Add convenience builder for ServerServiceDefinition
This adds back the previous builder, which eases upgrading.
2016-06-23 09:31:46 -07:00
Eric Anderson 66ab956f9e Reapply "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit ef178304cb, which
itself was a revert.
2016-06-23 09:27:47 -07:00
ZHANG Dapeng 2eaa540e35 doc: Status's cause is not transmitted from server to client (#1962) 2016-06-22 09:24:34 -07:00
Carl Mastrangelo 95d44b47f4 core: make ServerInterceptor non experimental
Fixes #1711
2016-06-22 09:05:23 -07:00
Carl Mastrangelo b51749baa4 core: make BindableService no longer experimental.
Fixes #1701
2016-06-22 09:03:26 -07:00
Kun Zhang d6a090a884 auth: handle null value from getRequestMetadata().
It appears some Credentials implementations may return null.
2016-06-21 16:56:50 -07:00
Kun Zhang 920d8a1bfc auth: revert ClientAuthInterceptor to its original implementation.
This partially reverts commit def237d960.

This is to avoid breaking internal tests that specifically verify the
behavior of the original implementation.
2016-06-21 15:59:05 -07:00
Eric Anderson 4372ceee06 android: Add ProGuard rules for NameResolverProvider
Without the rules, all RPCs fail since no providers are found. We like
the idea of RPCs working.
2016-06-21 14:57:31 -07:00
Eric Anderson b7ed883aec core: Avoid loading ManagedChannelProvider from NameResolverProvider
Not all users are triggering the loading of ManagedChannelProvider, so
avoid the unnecessary loading. Also, since class initialization is
involved, exception handling tends to get strange and hard to diagnose
issues.
2016-06-20 15:32:45 -07:00
Eric Anderson ef178304cb Revert "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit 3df1446deb.

The commit was adding to the difficulty of integration for testing. By
itself it isn't bad, so this is a temporary revert until the many other
commits are absorbed and then it will be reapplied.

This does have a manual edit for ClientCallsTest.
2016-06-20 15:18:18 -07:00
Kun Zhang 11a314e31a Delete the old ClientCall.cancel().
It's deprecated since 0.14.0.
2016-06-17 09:54:02 -07:00
Kun Zhang def237d960 auth: MoreCallCredentials.from(Credentials).
It converts Google Auth Library Credentials to CallCredentials, and
supersedes ClientAuthInterceptor, which is now deprecated.

Also swaps out the ClientAuthInterceptor implementation.

Caveat: This in fact changes ClientAuthInterceptor's behavior. Before
this change, if multiple ClientAuthInterceptors were attached, their
effects would be additive. After this change, only the last executed one
would take effect, and it would also overwrite the CallCredentials set
in CallOptions. We don't think it's an issue, since other languages also
only allow one call credentials to be attached to an RPC.
2016-06-16 16:07:54 -07:00
Jakob Buchgraber 63d8274661 core: don't create a new context for each client call. Fixes #1926
Also, undo the hack that makes sure AsyncClient's stack doesn't overflow as it's no longer needed.
2016-06-16 16:02:17 +02:00
Eric Anderson 26fb347f40 stub: Disable flaky test in ClientCallsTest (#1938)
The test has found a legitimate flake caused by a race in DelayedStream
related to onReady. Disable it until the fix arrives to prevent CI
failure noise.
2016-06-15 21:30:26 -07:00
Eric Anderson 93c34ef008 stub: Improve ClientCall test to fail more obviously
If the timoutout expires, the test will almost certainly fail now due to
responses not matching expected responses, but it isn't as obvious why
the test fails. Swapping to ArrayList prints the entire list when they
don't match, which also makes it easier to diagnose.

This is, in part, to help diagnose #1932
2016-06-15 17:03:20 -07:00
ZHANG Dapeng 95791b7507 okhttp: fix NPE when using CLEARTEXT connectionSpec
Resolves #1815

The only legitimate way to create plaintext connection with okhttp is by calling
OkHttpChannelBuilder#usePlaintex

Throw IllegalArgumentException when calling
OkHttpChannelBuilder#connectionSpec or Utils.convertSpec directly with CLEARTEXT a connectionSped argument.
2016-06-15 16:14:50 -07:00