Commit Graph

172 Commits

Author SHA1 Message Date
Carl Mastrangelo 893ef44b4c all/tests: add a ClientCall and ServerCall suitable for use in tests 2016-09-02 17:09:49 -07:00
Kun Zhang 58d78dd0aa core: add ServerTransportFilter
Called whenever a ServerTransport is ready and terminated.  Has the
ability to modify transport attributes, which ServerCall.attributes()
are based on.

Related changes:

- Attribute keys for remote address and SSL session are now moved from
ServerCall to a neutral place io.grpc.Grpc, because they can also be
used from ServerTransportFilter, and probably will be used on the
client-side too.  The old keys on ServerCall is marked deprecated and
are equivalent to the new keys.
- Added transportReady() to ServerTransportListener.

Resolves #2132
2016-08-31 14:45:15 -07:00
Carl Mastrangelo 48c6b3d398 all/tests: unmock ClientCall and ServerCall 2016-08-30 09:58:02 -07:00
nmittler f254fadfbe Add RunWith annotation to AutoWindowSizingOnTest 2016-08-26 07:18:57 -07:00
mfcripps 8a0c89a9f8 integration-tests: add integration tests for auto window sizing 2016-08-19 15:55:39 -07:00
Eric Anderson 092496bcc9 interop-testing: Remove hard-coded ports in ProxyTest 2016-08-19 12:58:12 -07:00
mfcripps d854da63d9 interop-tests: reduce flakiness of proxy tests 2016-08-19 12:46:20 -07:00
mfcripps 09d663faf1 integration test: add a flowcontrolling proxy and integration tests 2016-08-17 15:33:13 -07:00
Carl Mastrangelo 1285477133 all: add parameter name to checkNotNull
After debugging #2153, it would have been nice to know what the exact
parameter was that was null. This change adds a name for each
checkNotNull (and tries to normalized on static imports in order to
shorten lines)
2016-08-12 14:55:00 -07:00
Eric Anderson 5e1e88357c Update protobuf to 3.0.0
Fixes #2086
2016-07-29 09:31:15 -07:00
Eric Anderson 563baa4a20 interop: Fix flake in cascading test due to sleeps
The value of nodeCount depended on deadlines expiring after the chain
was constructed. This is effectively the same as using Thread.sleep()
and would commonly fail if the machine was under load.

Instead of checking nodeCount after the deadline expires, we now wait
for the chain to be constructed and then cancel the RPC. This also
ensures that the cancel propagates instead of each hop just enforcing
the deadline. As a bonus, this also reduces test execution time by one
second. A new test was added for deadline propagation.

Fixes #1852
2016-07-28 08:30:33 -07:00
ZHANG Dapeng 3a13aa5665 compiler: make Stub final class 2016-07-22 09:49:32 -07:00
ZHANG Dapeng e109125c62 compiler: add build option to enable deprecated generated code
partially resolving #1469

The added option for java_plugin `enable_deprecated` is `true` by default in `java_plugin.cpp`, so the generated code for `TestService.java` (`compiler/build.gradle` not setting this option) has all deprecated interfaces and static bindService method.

`./build.gradle` and `examples/build.gradle` set this option explicitly to `false`, so all the other generated classes do not have deprecated code.

Will set `enable_deprecated` to `false` by default in future PR when we are ready.
2016-07-21 16:35:18 -07:00
Louis Ryan c1ef8061d1 Fix selection of security Provider to conscruct SSLContext
Cleanup redundant API un TestUtils
Fix TlsTest to be ignored on JKD7 correctly
2016-07-18 14:25:27 -07:00
Eric Anderson e34f2cf3e0 interop: Add constant for necessary max message size
The max message size isn't necessary for the standard cross-language
interop tests, but only our own veryLarge tests.
2016-07-14 09:47:23 -07:00
Louis Ryan f52b4e52cd Make the OkHTTP transport AppEngine friendly. AppEngine may support
conscrypt at some point which would allow ALPN to function
Clarify the SSLContext.getDefault is not used when constructing the
default SSLSocketFactory.
2016-07-13 18:27:43 -07:00
Eric Anderson e9643bb5d7 Start 1.1.0 development cycle 2016-07-11 16:57:58 -07:00
Eric Anderson 0a98ff083b interop: Bump maxMessageSize for Android testing
This was missed in 16b096b5
2016-07-11 15:14:54 -07:00
Eric Anderson 16b096b571 Reduce default max message size to 4 MiB
Fixes #1676
2016-07-07 13:34:53 -07: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
Eric Anderson 46379da1a6 Start 1.0.0 development cycle 2016-07-01 11:46:33 -07: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
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
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 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
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 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
Eric Anderson a2076f4ec8 core: Enable per-message compression bit by default
This does not enable compression by default, but if the application
chooses to enable compression for a Call, messages will be compressed
without also needing to enable per-message compression.

Disabling per-message compression is intended as a security feature and
should be relatively rarely used, but it was the default. Thus we
required clients to use more advanced interfaces unnecessarily.

To keep client and server behavior consistent, the server also has
per-message compression enabled by default. However, to prevent
compressing on the wire by default, servers no longer enable compression
for the response by default.
2016-06-14 10:51:32 -07:00
Louis Ryan 3df1446deb Eliminate MethodDescriptor from startCall and interceptCall for servers
Make the MethodDescriptor a property of ServerCall
Move ServerMethodDefinition into ServerServiceDefinition
2016-06-13 14:39:58 -07:00
Jakob Buchgraber 7da48ae13e core: log exceptions thrown by Runnable's executed via schedule(..). Fixes #1237 2016-06-13 18:39:26 +02:00
Eric Anderson 7c722e440e codegen: Specify URL for ExperimentalApi
Fixes #1378. These are the last ExperimentalApis that didn't have their
own separate tracking issue.
2016-06-07 15:00:29 -07:00
Carl Mastrangelo 2ed39c92eb core: cache decompressor registry encodings, and make it copy on write 2016-06-02 09:10:42 -07:00
Carl Mastrangelo fa22259e3a netty: use custom Http2Headers class for encoding Metadata
Before:
Benchmark                              (headerCount)    Mode     Cnt     Score    Error  Units
HeadersBenchmark.convertClientHeaders             10  sample  127008   631.214 ±  3.543  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  142036  1125.874 ± 21.114  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  117570  2678.635 ± 47.764  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  115919  5427.720 ± 67.956  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  133903   610.970 ±  3.094  ns/op
HeadersBenchmark.convertServerHeaders             20  sample  138155  1154.304 ±  4.595  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  120078  2658.175 ± 38.679  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  120509  5212.341 ± 49.062  ns/op

After:
Benchmark                              (headerCount)    Mode     Cnt     Score    Error  Units
HeadersBenchmark.convertClientHeaders             10  sample  102473   407.383 ±  2.693  ns/op
HeadersBenchmark.convertClientHeaders             20  sample  103205   791.241 ± 38.054  ns/op
HeadersBenchmark.convertClientHeaders             50  sample  173817  1840.311 ±  5.718  ns/op
HeadersBenchmark.convertClientHeaders            100  sample  169984  3690.753 ± 44.308  ns/op
HeadersBenchmark.convertServerHeaders             10  sample  103615   401.661 ±  2.922  ns/op
HeadersBenchmark.convertServerHeaders             20  sample   99060   823.453 ±  5.553  ns/op
HeadersBenchmark.convertServerHeaders             50  sample  171824  1846.788 ± 29.840  ns/op
HeadersBenchmark.convertServerHeaders            100  sample  171622  3670.354 ±  7.127  ns/op
2016-05-25 17:23:51 -07:00
ZHANG Dapeng b7eea7c13a implements health check service
resolves #647
2016-05-20 14:03:29 -07:00
Carl Mastrangelo e19848092d core, interop-testing: always set message encoding, and use it in interop tests
This change updates the behavior of the core compression semantics.  Previously,
if the codec was "identity", nothing was set on the wire.  This is allowed by
the spec, but doesn't match what wrapped languages do.

Additionally, the interop tests will now attempt to honor the requested
compression.
2016-05-18 12:04:25 -07:00
Eric Anderson a70e1a4d8b interop: Don't catch AssertionError as it makes test failure confusing 2016-05-16 09:52:48 -07:00
Carl Mastrangelo f13fbaa782 interop-testing: update testing protos to include compression fields 2016-05-13 11:00:33 -07:00
Jakob Buchgraber 46edcad0c1 Don't enforce a timeout in stress test client. Fixes #1812 (#1823) 2016-05-13 19:18:13 +02:00
Carl Mastrangelo f85ecdfbc4 interop-testing: Print JVM Flags by default for Stress tests 2016-05-11 13:20:23 -07:00
Eric Anderson 83bf5e6f42 Fix flakiness of testConfigureDeadlineNanoTime with warmup
Without the warm up I saw large deltas, like 2,262,968ns and
1,712,558ns, on my machine. With the single-line warm up the deltas
decreased dramitically, like 385ns and 536ns. Since our times are so
much better now, decreasing the required delta to 10ms seems reasonable.

This would seem to support the theory that the flakiness was caused by
the class loader, which may even be doing I/O.

Fixes #1646
2016-05-06 09:41:46 -07:00
ZHANG Dapeng aed886d8de use Jetty ALPN agent instead of Jetty ALPN
#1497
2016-05-02 14:01:36 -07:00
Carl Mastrangelo 3c5b5a5e09 Begin v0.15.0 Cycle 2016-04-29 13:54:18 -07:00
Eric Anderson ac4168a236 Revert "Update proto packages to reflect directory structure"
This reverts commit 8825f355df.

The commit changed the package name of services that were used across
languages. That broke their functionality pretty severely. The changes
require more coordination with others.
2016-04-28 10:42:47 -07:00
Jakob Buchgraber cd89dde625 Fix race in StressTestClientTest.gaugesShouldBeExported(). Fixes #1695 (#1728) 2016-04-27 15:20:11 -07:00
Carl Mastrangelo 8825f355df Update proto packages to reflect directory structure 2016-04-27 14:16:28 -07:00
Carl Mastrangelo 38a91f83e1 Fix lint warnings found on internal import 2016-04-26 13:21:25 -07:00
nmittler 7e8b504e3f Add javadoc to grpc codegen based on proto docs
Fixes #1612
2016-04-22 13:23:17 -07:00
Kun Zhang 8502730d07 Attach an exception to client-initiated CANCELLED.
This tells us where is the cancellation initiated, which is important
information for debugging.
2016-04-20 17:38:01 -07:00
Carl Mastrangelo fe7e8a00bc Use correct Guava API in stress test client 2016-04-20 11:58:39 -07:00