aboutsummaryrefslogtreecommitdiff
path: root/context
AgeCommit message (Collapse)Author
2018-10-02Start adding Soong build files for grpc-grpc-javamaster-cuttlefish-testing-releaseJulien Desprez
Add basic build files for the grpc-java modules. Still need to be added: netty, protobuf Test: make Bug: None Change-Id: I9248dd23c0ec24ec0f9a15aa6f6d826b7b90d617
2018-09-14all: use Java7 bracketsCarl Mastrangelo
2018-08-09all: update animalsniffer to Java 7 and add Android 14 (#4727)Eric Gribkoff
2018-07-20context: Avoid deprecated Truth APIEric Anderson
This helps an internal cleanup removing the old failWithRawMessage API.
2018-05-15context/core/netty: Add @CheckReturnValue to ContextZHANG Dapeng
By adding inner class annotations without introducing external dependencies.
2018-05-03 all: normalize copyright header Carl Mastrangelo
2018-02-15context: remove context profilingCarl Mastrangelo
2018-02-09context: add basic context profilingCarl Mastrangelo
2018-01-26Update opencensus to 0.11.0 and remove extra dependencies.Bogdan Drutu
2017-12-04Update to Truth 0.36Eric Anderson
Due to transitive dependencies, this also upgrades Guava to 22. However Truth is only used in our tests, so our users should be unimpacted.
2017-11-22testing: Remove DeadlineSubjectEric Anderson
The class is still used internally, so we move it to context's tests for it to be reused. To avoid a circular dependency with context's tests depending on core's tests, StaticTestingClassLoader was also moved to context's tests. This is driven by a need to modernize DeadlineSubject for newer versions of Truth, but the newer versions of Truth update Guava. To avoid leaking the Guava update to all users of grpc-testing, we're removing the Subject. In our internal tests we can update the Truth dependency with less issue.
2017-10-25context: Make CancellableContext implement Closeable (#3607)zpencer
2017-09-20context: Use .class literal instead of Class.forNameEric Anderson
Found via ErrorProne
2017-09-20Avoid catching AssertionError in testsEric Anderson
Found via ErrorProne
2017-09-14context: log severe warning if ancestry chain too long (#3459)zpencer
If a context has an unreasonable number of ancestors, then chances are this is an application error. Log the stack trace to notify the user and aid in debugging.
2017-08-28Move jmh benchmarks to their respective modulesEric Anderson
The benchmarks should be close to the code they're benchmarking, like we do with tests. This includes a bugfix to SerializingExecutorBenchmark to let it run. The io.grpc.benchmarks.netty benchmarks in benchmarks/ depend on ByteBufOutputMarshaller from benchmarks's main, so they were not moved.
2017-08-28context: add RunWith annotationEric Gribkoff
2017-08-28context: Use polymorphism instead of canBeCancelled fieldEric Anderson
2017-08-28context: Remove superfluous cascadesCancellation fieldEric Anderson
2017-08-24context: Store Deadline in CancellableContext directlyEric Anderson
2017-08-22context: compress cancellation ancestor chain (#3372)zpencer
Now that we have the copy of write keyvalue store (#3368), there is no need to keep the full parent chain. We only need a reference to the nearest cancellable ancestor. This optimization should in theory make cancellations more efficient and also make our data structs more GC friendly.
2017-08-22context: remove unused fields from removed bloomfilter (#3371)zpencer
remove unused fields from removed bloom filter
2017-08-21context: hashtrie based keyvalue store (#3368)zpencer
This is the hashtrie data structure authored by @ejona86 The linked list key value store is known cause problems in pathological cases where users keep updating the same key(s) over and over. This copy on write tree will bound reads at O(lgN) where N is the number of keys in the map, rather than O(lgM) where M is the total number of put operations. Also: - added some unit tests - ran a test putting random keys into the map and comparing the result with a java.util.HashMap to verify sanity. The test passes but I won't check it into the repo because it takes a long time to run: https://gist.github.com/zpencer/12cb435235d171c1fe09aef18825fad0
2017-08-16add bloom filter to Context (#3350)zpencer
* This is the bloom filter based context improvement authored by @lukesandberg
2017-08-11all: Fix mismatch in naming Bazel Maven jarsPaul Gross
This commit aligns the naming of the Bazel Maven jars with the names used by Bazel's migration-tooling project: https://github.com/bazelbuild/migration-tooling Unfortunately, we can't fix @com_google_protobuf_java because it's required by Bazel itself. Fixes #3328
2017-08-10context: change storage API to return a restoreable context (#3292)zpencer
This API change allows storage implementations to put some state information into the return value, giving it the ability to act as a cookie. In environments where contexts can be replaced, the current original context can be stashed there and be restored when detach is called.
2017-07-25context: Create TimeoutException only when deadline occursVladimir Gordiychuk
Use deadline on client calls lead to create TimeoutException even if deadline not occurs yet. fillStacktrack very expensive operation that allocate many unnecessary objects in heap. Now exception creates only when deadline occurs. Close #3272
2017-07-21context: add test for the scenario that Context's logger itself is using ContextZHANG Dapeng
This will break if 7f1ac34d41d1f818d1702b25eefb5f6ef3423e69, 2f6e2c87ab1aeda591fcb7764a8ad6bb20855a2a, a3a5420922ecf1ddc2c4ab77c273be3df47b74f5 are reverted: ``` io.grpc.ContextTest > initContextWithCustomClassLoaderWithCustomLogger FAILED java.lang.ExceptionInInitializerError at io.grpc.ContextTest$LoadMeWithStaticTestingClassLoader.run(ContextTest.java:789) at io.grpc.ContextTest.initContextWithCustomClassLoaderWithCustomLogger(ContextTest.java:760) Caused by: java.lang.RuntimeException: Storage override had failed to initialize at io.grpc.Context.storage(Context.java:134) at io.grpc.Context.current(Context.java:163) at io.grpc.ContextTest$LoadMeWithStaticTestingClassLoader$1.publish(ContextTest.java:773) at java.util.logging.Logger.log(Logger.java:738) at java.util.logging.Logger.doLog(Logger.java:765) at java.util.logging.Logger.log(Logger.java:875) at io.grpc.Context.<clinit>(Context.java:122) ... 2 more ```
2017-07-20context: Lazy load storageEric Anderson
Using static initialization is possible, but quite complex to handle logging and circular loading. Lazy loading prevents an entire class of circular dependencies.
2017-07-06context: stop using logger at all in static initialization. (#3191)Kun Zhang
Turns out avoiding log() alone in the static initialization is not enough. isLoggable() can also be overridden and call back to Context. We take a another approach, save the exception and log it outside of the initialization block.
2017-06-30all: Use fixed version number for java 6/7 signaturesEric Anderson
This is important for stable builds, as if the signature changes the old source may no longer validate.
2017-06-22build: Add Bazel java_grpc_library ruleSimon Horlick
Bazel third party dependencies are specified in repositories.bzl which gives the consumer the ability to opt-out of any dependencies they use directly in their own project. Fixes #2756
2017-06-06context: declare that context should not be mockedCarl Mastrangelo
2017-06-01all: fix licence whitespaceCarl Mastrangelo
2017-05-31all: update to Apache 2 licenceCarl Mastrangelo
Also, update the authors.
2017-05-17all: Minor updates to expand javadocs (#2991)zpencer
all: Minor updates to expand javadocs
2017-05-15Javadoc improvements, especially to ContextEric Anderson
2017-03-16core: annotate some keys with Immutable; Context.Key finalZHANG Dapeng
2017-02-16all: prepare for ErrorProne's FutureReturnValueIgnoredEric Anderson
Futures almost universally should be handled in some way when being returned, either to receive the value or to cancel scheduled tasks to prevent leaks. Netty is a bit of a special case though, since it constantly returns futures that you ignore (even adding a listener returns the "this" future). So we want to suppress the warning for code using Netty instead of trying to fix it. When we enable ErrorProne in the build, we should start passing -Xep:FutureReturnValueIgnored:OFF in the compilerArgs.
2017-02-07all: swap to newer animalsniffer pluginEric Anderson
The new plugin uses a newer version of animalsniffer, allows overriding the animalsniffer version used, and has up-to-date handling. The up-to-date handling cuts fully incremental parallel build times in half, from 5.5s to 2.7s. The previous plugin was supposed to be verifying tests. However, either it wasn't verifying them or its verification was broken.
2017-01-26all: update to latest import orderingCarl Mastrangelo
2017-01-20docs: clarify requirements of detach(). (#2630)Kun Zhang
2017-01-10context: don't log to logger in static initialization. (#2581)Kun Zhang
2017-01-06context: put ContextStorageOverride in io.grpc.override. (#2570)Kun Zhang
To make it easier to filter.
2016-12-21core: remove a benign data race. (#2546)Kun Zhang
This is an alternative to #2543 and it doesn't introduce volatile usage.
2016-12-13context: add the four-value withValues(). (#2506)Kun Zhang
2016-12-08context: Fix ErrorProne ClassNewInstanceEric Anderson
http://errorprone.info/bugpattern/ClassNewInstance
2016-12-02context: pluggable Storage mechanism. (#2461)Kun Zhang
Currently Context propagate in-thread by its own ThreadLocal, and cross-thread propagation must be done with the mechanisms provied by gRPC Context. However, there are frameworks (e.g. what we are using inside Google) which have already established context-propagation mechanisms. If gRPC Context may ride on top of them, it would be propagated automatically without additional effort from the application. The Storage API allows gRPC Context to be attached to anything. The default implementation still uses its own ThreadLocal. If an override implementation is present, gRPC Context will use it.
2016-09-02core: split Context into a separate grpc-context artifact.Kun Zhang
The Context API is not particularly gRPC-specific, and will be used by Census as its context propagation mechanism. Removed all dependencies to make it easy for other libraries to depend on.