Commit Graph

1818 Commits

Author SHA1 Message Date
Kenji Kaneda 5ff16dd4c6 core: Make tiny fixes to InUseStateAggregator2 and InternalSubchannel (#2466)
- Remove unused variable terminated from TransportListener#transportTerminated
- Do not mention getLock in the javadoc of InUseStateAggregator2#handleNotInUse
2016-11-30 16:03:21 -08:00
Carl Mastrangelo 5269a1b969 netty: call the client ssl negotiation handler
* netty: call the client ssl negotiation handler
2016-11-30 08:47:20 -08:00
ZHANG Dapeng b24d263192 internal/test: make FakeClock more thread-safe (#2452)
FackeClock used PriorityQueue for storing tasks which is not
thread-safe, and caused flake

> io.grpc.internal.ClientCallImplTest > deadlineExceededBeforeCallStarted FAILED
>     java.lang.ArrayIndexOutOfBoundsException: -1
>         at java.util.PriorityQueue.removeAt(PriorityQueue.java:619)
>         at java.util.PriorityQueue.remove(PriorityQueue.java:378)
>         at io.grpc.internal.FakeClock$ScheduledTask.cancel(FakeClock.java:89)
>         at io.grpc.internal.ClientCallImpl.removeContextListenerAndCancelDeadlineFuture(ClientCallImpl.java:296)
>         at io.grpc.internal.ClientCallImpl.start(ClientCallImpl.java:250)
>         at io.grpc.internal.ClientCallImplTest.deadlineExceededBeforeCallStarted(ClientCallImplTest.java:615)
2016-11-28 18:14:21 -08:00
ZHANG Dapeng 6dc4633bdd stub: add withWaitForReady 2016-11-28 18:13:22 -08:00
Kun Zhang c1a798486b core: address data race in StatsTraceContext. (#2454)
Document the threading requirements.

Turn all metrics to volatile because callEnded() may not be synchronized
with other metric-updating methods in the case where the RPC is closed
because of transport error or cancellation from the other side.

Remove precondition checks thus allow metrics updating methods to be
called after callEnded() has been called, which may happen since the
application may not be aware when the RPC is closed by the transport.
2016-11-28 18:05:41 -08:00
Kun Zhang 6da8f471f7 compiler: whitelist USER32.DLL. (#2455)
The 32-bit windows grpc codegen built with protobuf 3.0.2 depends on
USER32.DLL, while the previous release built with protobuf 3.0.0 didn't.
Both protobuf and grpc codegen are built under msys2-mingw32.

"objdump -x libprotobuf-10.dll | grep DLL" also shows the USER32.DLL
dependency being brought by protobuf:

3.0.0

 DLL Name: KERNEL32.dll
 DLL Name: msvcrt.dll
 DLL Name: zlib1.dll
 DLL Name: libgcc_s_dw2-1.dll
 DLL Name: libstdc++-6.dll

3.0.2

 DLL Name: KERNEL32.dll
 DLL Name: msvcrt.dll
 DLL Name: USER32.dll
 DLL Name: zlib1.dll
 DLL Name: libgcc_s_dw2-1.dll
 DLL Name: libstdc++-6.dll

While unexpected, USER32.dll is shipped with Windows so having such
dependency shouldn't cause any trouble.
2016-11-28 17:45:11 -08:00
Carl Mastrangelo c408eadf22 core: add javadocs to internal methods in MethodDescriptor 2016-11-28 14:09:16 -08:00
Eric Gribkoff c8c9fff679 services: Proto reflection service 2016-11-28 13:20:55 -08:00
Carl Mastrangelo 6c589e1933 core: reverse dependency from core/internal classes, so that it is now one directional. 2016-11-28 10:27:51 -08:00
Eric Anderson 0207354994 travis: Remove old comment for broken OS X caching
Commit 80f73a4a was in response to OS X receiving caching support.
Caches began being saved shortly after and they've been working since.
The official announcment was
https://blog.travis-ci.com/2016-05-03-caches-are-coming-to-everyone
2016-11-23 23:25:17 -08:00
Eric Anderson 335638e4fa travis: Use default OS X image (xcode7.3)
The xcode7 image is being retired on Nov 28th[1]. The default has been
7+ for a while now[2]. I assume 7+ all have JDK 8, so using the default
seems safe.

1. https://blog.travis-ci.com/2016-11-17-retiring-some-osx-images/
2. https://blog.travis-ci.com/2016-09-15-new-default-osx-image-coming/
2016-11-23 23:24:53 -08:00
Carl Mastrangelo 18e628ab1d all: update to gradle 3.2
* all: update to gradle 3.2
2016-11-23 14:43:18 -08:00
Eric Gribkoff 0ec395dc30 interop-testing: apply --server_host_override regardless of flag order
apply --server_host_override regardless of flag order in the stress test client
2016-11-23 10:44:52 -08:00
Kun Zhang 6a04022d7a core: InternalSubchannel: the new TransportSet. (#2427)
This is the first step of a major refactor for the LoadBalancer-related part of Channel impl (#1600). It forks TransportSet into InternalSubchannel and makes changes on it.

What's changed:

- InternalSubchannel no longer has delayed transport, thus will not buffer
  streams when a READY real transport is absent.
- When there isn't a READ real transport, obtainActiveTransport() will
  return null.
- InternalSubchannel is no longer a ManagedChannel
- Overhauled Callback interface, with onStateChange() replacing the
  adhoc transport event methods.
- Call out channelExecutor, which is a serializing executor that runs
  the Callback.

The first commit is an unmodified copy of the files that are being forked. Please review the second commit which changes on the forked files.
2016-11-22 22:32:27 -08:00
Kun Zhang 325c965fdc example: really fix the loss of precision error (#2435) 2016-11-22 22:17:36 -08:00
Kun Zhang a05892a9fe examples: address ErrorProne and warnings. (#2433)
Discovered when importing grpc to internal repo:

1. ErrorProne: Compound assignments from floating point to integral
types hide dangerous casts.

2. found raw type: io.grpc.ManagedChannelBuilder missing type arguments
  for generic class io.grpc.ManagedChannelBuilder<T>
2016-11-22 15:17:44 -08:00
Eric Gribkoff 08e948353c interop-testing: new stress test client command line options (#2413)
* interop-testing: modify the stress test client to accept the same --use_tls, --use_test_ca, and --server_host_override arguments as the interop client. 

Clarify usage of --use_test_ca=true for stress and interop clients.
2016-11-21 09:03:24 -08:00
ZHANG Dapeng e70f7b421c all: cleanup - errorprone, unused 2016-11-16 19:15:16 -08:00
Carl Mastrangelo e0e13c4897 examples: don't use System.lineSeparator if unsupported
Fixes: #2425
2016-11-16 16:02:17 -08:00
Eric Anderson 06697b5376 doc: link to IDE-specific docs for os-maven-plugin 2016-11-15 22:34:50 -08:00
ZHANG Dapeng 7306df4266 examples: unit test examples for users
Demonstrate unit testing gRPC clients and servers with `InProcessTransport`.
2016-11-15 14:15:55 -08:00
Kun Zhang 7311572236 core: fix a benign data race in NoopCensusContextFactory. (#2421)
NoopCensusContextFactory used to use a shared zero-sized ByteBuffer,
which has mutable states like positions and thus is not thread-safe.
Sharing it means it will be used by all calls thus may be used from
different threads, which makes TSAN unhappy in tests.

Resolves #2377
2016-11-15 11:19:20 -08:00
Benjamin Ellenberger 8826bb5e3e Remove UTF-8 symbols in example to simplify compilation for most people. 2016-11-14 21:49:34 -08:00
ZHANG Dapeng 0d694c80ee core,netty: quick patch for setListener regression
resolves grpc/grpc#8715
now that setListener is called prior to
`JumpToApplicationThreadServerStreamListener` being completely ready to
use. We should not call `AbstractStream2#onStreamAllocated()` inside
`setListener()` anymore, but call it after `ServerImpl#streamCreated()`
is completed.
2016-11-11 19:39:16 -08:00
ZHANG Dapeng 0e27eef168 core: fix bug when stream listener not set before stream closed
Resolves #1936

Two bugs fixed:
- NPE in `ServerImpl#streamCreated()` when stream listener not set before
  stream closed
- It is possible that `internalCancel()` is called during
  `InProcessClientStream#start()` due to early server `onComplete()` or server `onError()`,
  in this case no need to enlist `streams`, otherwise the channel can not be shutdown by `shutdown()`.
2016-11-09 15:21:11 -08:00
ZHANG Dapeng e40668499c netty: add channel options in NettyChannelBuilder
Add `withOption(ChannelOption<T> option, T value)` method to
`NettyChannelBuilder`. This allows user to set a custom TOS.
2016-11-09 13:32:05 -08:00
Carl Mastrangelo 944879dbbb benchmarks: reuse executor between channels
Perhaps by accident, each LoadClient channel got its own executor
pool rather than sharing between all of them.  The benchmarks are
currently set up with C++ idioms, creating 64 "channels" per
client.  C++ uses one thread per channel, while java does not,
leading to a threading model mismatch.

ForkJoinPool is the current executor because it has good contention
characteristics.   However, FJP is also very sensitive to the
number of actively running tasks.  Too many, and the contention
will go up.  Too few, and threads will repeatedly go to sleep and
wake up.

This change basically makes the FJP shared for all clients in the
same process.  It doesn't try at all to shut it down properly or
be generally useful; it's just a benchmark.  Additionally, this
also groups the Netty and OkHttp specific channel options into
helper functions.  This means OkHttp benchmarks will also use
the correct executor now.

A quick test shows QPS going from ~107kqps to 149kqps.

Fixes: #2406
2016-11-09 09:52:02 -08:00
ZHANG Dapeng 809cf1bc8c core: MutableHandlerRegistry#addService with BindableService arg 2016-11-04 18:25:46 -07:00
Łukasz Strzałkowski d954bc2a51 Typo in version number
3.10 -> 3.1
2016-11-04 10:18:18 -07:00
Carl Mastrangelo 636b43b871 benchmarks: print gc detail and vm flags for benchmarks 2016-11-03 12:55:42 -07:00
Carl Mastrangelo 91e61ec406 github: add an issue template
Fixes: #2393
2016-11-02 15:28:47 -07:00
dave 540f70e870 ProtoUtil.jsonMarshaller can be supplied a JsonFormat Parser and Printer
This allows for customizing the printer and parser behaviour
2016-11-02 15:24:13 -07:00
Carl Mastrangelo f6c333eefe benchmarks: check shutdown after acquiring a token, and weaken error messages on shutdown 2016-11-02 13:08:16 -07:00
Eric Anderson 2e7e25d1f2 core: Update HTTP status to gRPC status mapping
Proxies can trigger errors, and we'd like to categorize common
proxy-generating errors into gRPC status codes for sane application
handling.

Fixes #2264
2016-11-01 17:35:18 -07:00
Eric Anderson 78107a69c0 core: Do not rely on HTTP 200
We only want to use the HTTP code for errors, when the response is not
grpc. grpc status codes may be mapped to HTTP codes in the future, and
we don't want to break when that happens. We also don't want to ever
accidentally use Status.OK without receiving it from the server, even
for HTTP 200.
2016-11-01 17:35:15 -07:00
Eric Anderson c38611a230 Bump protobuf to 3.1.0
Also removed warnings about protoc version matching runtime, since this
is no longer supposed to be a problem (starting with 3.0.0-beta-4) and
all our tests ran fine when using protoc 3.0.2 with protobuf runtime
3.1.0.

Fixes #2316
2016-11-01 14:52:56 -07:00
Eric Anderson 483662e24d interop-testing: -PskipCodegen requires =true
Otherwise it has no effect.
2016-11-01 14:45:40 -07:00
Eric Gribkoff abffc76da2 addressing reviewer comments 2016-10-28 08:45:32 -07:00
Eric Gribkoff aff1cac7da Compiler/core changes to support the proto reflection API
core: adds @Nullable Object getAttachedObject() to ServiceDescriptor

compiler: Plumbing necessary to access proto file descriptors via
the reflection service
2016-10-28 08:45:32 -07:00
Carl Mastrangelo 9eb8f15110 interop-testing: fix lint errors found on import 2016-10-27 16:52:46 -07:00
Carl Mastrangelo d019eead63 android-interop-testing: use new channel builder size limit 2016-10-27 14:37:02 -07:00
Carl Mastrangelo fdd062c465 core: make max message size part of the public API 2016-10-27 14:11:44 -07:00
Eric Anderson 98f4e41e7f benchmarks: Avoid sending a message after half close
This doesn't impact test behavior per-se, but causes it to produce less
useless log output of the form:

java.lang.IllegalStateException: call was half-closed
	at com.google.common.base.Preconditions.checkState(Preconditions.java:174)
	at io.grpc.internal.ClientCallImpl.sendMessage(ClientCallImpl.java:380)
	at io.grpc.stub.ClientCalls$CallToStreamObserverAdapter.onNext(ClientCalls.java:299)
	at io.grpc.benchmarks.driver.LoadClient$AsyncPingPongWorker$1.onNext(LoadClient.java:406)
	at io.grpc.benchmarks.driver.LoadClient$AsyncPingPongWorker$1.onNext(LoadClient.java:400)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:382)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessageRead.runInContext(ClientCallImpl.java:473)
	... 7 more

Fixes #2372
2016-10-26 15:55:19 -07:00
Carl Mastrangelo 2417660687 netty: fix static data race on handler settings 2016-10-26 13:52:10 -07:00
Nishidha 862157a84b Changes to add support of Power8 little endian 2016-10-25 15:18:10 -07:00
Eric Anderson 496a621da7 core: Use grace period to avoid exitIdleMode in fast path
Fixes #2119
2016-10-25 13:04:26 -07:00
Eric Gribkoff 33d99ce938 Add UNIMPLEMENTED_METHOD interop test case.
Rename old UNIMPLEMENTED_METHOD test case to UNIMPLEMENTED_SERVICE.
2016-10-25 10:02:07 -07:00
Carl Mastrangelo 8702185e8c netty: use memory efficient slice in Buffer 2016-10-20 13:29:36 -07:00
Carl Mastrangelo 894802e3ec compiler: lazily generate ServiceDescriptors 2016-10-19 16:52:47 -07:00
Jakob Buchgraber 6fa63a6371 netty: Upgrade to 4.1.6 and tcnative Fork23. Fixes #2224 (#2349) 2016-10-20 00:24:58 +02:00