Commit Graph

750 Commits

Author SHA1 Message Date
Xudong Ma ca7587f641 Change some error status usages to be consistent with other gRPC implementations. 2015-08-13 13:14:21 -07:00
Carl Mastrangelo 0c7466cdf7 Bump gRPC to version 0.9.0 2015-08-12 15:10:22 -07:00
Kun Zhang 0eb98621ed Annotations for unstable and internal interfaces.
- Add `@Internal` and `@ExperimentalApi`, both are annotated `@Internal`
- Annotate `@Internal` to `package io.grpc.internal`
- AbstractChannelBuilder.ChannelEssentials is annotated `@Internal`
- ChannelImpl.ping() is annotated `@ExperimentalApi`
- Context is annotated `@ExperimentalApi`
- Add `package-info.java` to `io.grpc.inprocess` and `io.grpc.internal`.
2015-08-12 15:03:23 -07:00
Carl Mastrangelo 7a6b166a6d Updated docs 2015-08-12 14:33:09 -07:00
Xudong Ma a4c7d9a08a Redo b1e2aaebc0, with some changes to prevent test flaky. 2015-08-12 13:50:26 -07:00
Kun Zhang e1bd6ef45f Clean up the left-over of the transport package reorganization 2015-08-11 12:48:02 -07:00
Kun Zhang 9eed577d3d Revert "okHttp: Set max_concurrent_stream to 0 before the connection is connected."
This reverts commit b1e2aaebc0.
Broke tests.
2015-08-11 12:42:54 -07:00
Eric Anderson 66ce0f2060 Add code coverage badge to README.md
Moving to below the header reduces the amount of whitespace between them
and the rest of the text.
2015-08-11 12:25:17 -07:00
Xudong Ma b1e2aaebc0 okHttp: Set max_concurrent_stream to 0 before the connection is connected.
So that the written messages will be queued inside the pending stream instead of the serializingExecutor.
2015-08-11 11:36:26 -07:00
Eric Anderson 522580dd0e Add coveralls support 2015-08-11 11:26:21 -07:00
Kun Zhang f681b5f8be Move Marshaller into MethodDescriptor 2015-08-11 10:53:38 -07:00
Xudong Ma ddea7435c9 Remove stream id check for writing path, it breaks the starting of pending streams.
And fixes OkHttpClientTransport.mayHaveCreatedStream() for the case that streamId is Integer.MAX_VALUE - 2.
2015-08-11 09:36:42 -07:00
Xudong Ma b42122b035 Update test to demonstrate that pending streams will not be started if the transport is in goAway status. 2015-08-10 17:03:59 -07:00
Kun Zhang d2929cd1a3 Reorganize packages.
Reserve io.grpc for public API only, and all internal stuff in core to
io.grpc.internal, including the non-stable transport API.

Raise the netty/okhttp/inprocess subpackages one level up to io.grpc,
because they are public API and entry points for most users.

Details:

- Rename io.grpc.transport to io.grpc.internal;
- Move SharedResourceHolder and SerializingExecutor to io.grpc.internal
- Rename io.grpc.transport.{netty|okhttp|inprocess} to
  io.grpc.{netty|okhttp|inprocess}
2015-08-10 15:04:29 -07:00
Eric Anderson be965b86ab Remove extraneous shutdown condition in NettyClientTransport
We didn't do the extraneous check in notifyTerminated()...
2015-08-10 13:40:45 -07:00
Eric Anderson 6236968d4b netty: Provide useful information if connect fails
Previously you would get an error saying, "Transport failed during
protocol negotiation" and no further information.
2015-08-10 13:24:04 -07:00
Eric Anderson 2addeae2db NettyClientHandler should handle all exceptionCaught()s
If NettyClientHandler doesn't then the exception will propagate to the
end of the pipeline, get logged, and cause any open calls to hang.
2015-08-10 13:24:03 -07:00
Eric Anderson 849ed1b995 netty: Simplify ping cancellation
ChannelInactive should be called in all cases of channel going down, so
we only need to cancel ping there. Use goAwayStatus for the error, since
we will be putting the most effort into making that status useful.
2015-08-10 13:24:00 -07:00
Eric Anderson 017cdd2ae9 netty: Remove connectionError and just use goAwayStatus
When connectionError was set, goAwayStatus was also set, so we shouldn't
lose any errors.

NettyClientTransport doesn't really need a Throwable, it just needs a
Status. Passing a Status out of NettyClientHandler reduces the number of
places that need to do transport-specific translation of Throwables into
Status codes.
2015-08-10 13:23:27 -07:00
Eric Anderson e1c348c24a netty: Don't double-process ssl handshake failures
As described in SslHandler's documentation, handshakeFuture() and
SslHandshakeCompletionEvent are equivalent forms of learning of
handshake completion. Watching both causes double-logging and serves no
purpose.
2015-08-10 12:38:47 -07:00
Eric Anderson 8d38d03c2f netty: If negotiation fails, continue failing new writes
Otherwise new writes will be written to the channel and will fail in
some unhelpful way.

Logging was removed as we really want to propagate the failure back to
the application via Calls, which is done by failing the
CreateStreamCommand message. Propagating back to the application via
call removes uncontrollable log spam and is necessary anyway to inform
the application what sort of failure occurred in order to appropriately
to react.
2015-08-10 12:38:46 -07:00
Jack Coughlin 3eaa92bea6 Send an RST_STREAM frame on server deadline 2015-08-10 09:51:54 -07:00
mekka 9990794b40 Documentation hygiene. Fixing some minor typos in the README file. 2015-08-07 23:28:06 -07:00
Eric Anderson 9bd7baba56 Produce cleaner JavaDoc and Jacoco output
Instead of producing output for all projects, just do it for projects
that matter to our users.
2015-08-07 17:23:08 -07:00
Carl Mastrangelo 4b4f76da8c Remove deprecated classes from ServerInterceptors 2015-08-07 11:39:00 -07:00
Xudong Ma ba103fb871 OkHttp: make the pending stream cancellable. 2015-08-07 11:25:28 -07:00
Carl Mastrangelo 7d3d80e69f Add a javadoc for AbstractChannelBuilder.buildEssentials 2015-08-07 11:09:26 -07:00
Carl Mastrangelo 9b733b57e0 Add a javadoc for AbstractServerBuilder.buildEssentials 2015-08-07 10:01:48 -07:00
Carl Mastrangelo b141093b3b Make serverInterceptor use MethodDescriptor 2015-08-07 09:28:29 -07:00
Eric Anderson 6ff7b220b6 Improve generics in {Client,Server}Interceptors 2015-08-06 17:34:17 -07:00
Kun Zhang fc85a4085a Add more documentation for transports.
- Add package descriptions for transport, netty and okhttp.
- Describe transports (netty, okhttp and inprocess) in README
2015-08-06 17:24:42 -07:00
Xudong Ma b737435d0d Tighten up some access limit 2015-08-06 15:25:51 -07:00
Carl Mastrangelo aebb58b200 Change awaitTerminated to awaitTermination 2015-08-06 13:52:17 -07:00
Carl Mastrangelo a947178698 Remove deprecated ClientInterceptors classes 2015-08-06 13:46:02 -07:00
Carl Mastrangelo b7822e8f88 Fix javadoc, and remove deprecated classes 2015-08-06 12:27:45 -07:00
Xudong Ma 7faeab6b45 Make NanoProtoInputStream package private 2015-08-06 11:12:32 -07:00
Kun Zhang 9992156bd8 Add available() to KnownLength 2015-08-06 10:04:31 -07:00
Carl Mastrangelo e76b8e7ee8 Renamed Server payload to message 2015-08-05 17:10:37 -07:00
Carl Mastrangelo 67fc45d036 Rename Duplex to Bidi 2015-08-05 17:05:47 -07:00
Eric Anderson e45c0c53d0 Fix shutting down a never-started ServerImpl 2015-08-05 16:56:55 -07:00
Xudong Ma 7d1e65c111 Switch ALPN/NPN to advertise only h2 2015-08-05 11:25:05 -07:00
Eric Anderson 2f799ed465 OkHttp should use plaintext in TransportBenchmark
Otherwise, OkHttp fails because it is connecting to a plaintext server.
2015-08-05 09:17:41 -07:00
Xudong Ma d1e15ab859 Fix serviceAccountCreds test and computeEngineCreds test.
See #702 for details.
2015-08-04 18:11:59 -07:00
Xudong Ma ef106e0593 Make the change on status effective. 2015-08-04 18:06:25 -07:00
Eric Anderson f68c10baab Don't hold channel/server lock when shutting down transport
Holding the lock while calling the transport can cause a deadlock, as
shown in #696. In previous auditing for deadlock prevention I considered
heavily Call interactions, but failed to consider shutdown() and realize
it was holding a lock while calling transport.shutdown().

We still hold a lock when calling transport.start(). Although it is
conceivable that this could cause a deadlock as the code evolves over
time, I don't believe it can cause a deadlock today or that the risk is
very high. In addition, it would require more effort to solve.
2015-08-04 16:51:24 -07:00
Carl Mastrangelo 2c2c48a592 Implement Transport reconnect 2015-08-04 13:19:35 -07:00
Xudong Ma 512134b095 Android-Interop-test: fix lint errors/warnings, enable proguard. 2015-08-04 10:52:20 -07:00
Eric Anderson 41d875c7e3 Notify transportReady() in Netty 2015-08-03 16:50:05 -07:00
Kun Zhang 137b2ef8c3 Upgrade protobuf-gradle-plugin to 0.6.1 2015-08-03 13:41:48 -07:00
Xudong Ma c55657e3c5 Make new stream call asynchronous when the MAX_CONCURRENT_STREAMS is reached. 2015-08-03 11:38:18 -07:00