Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PRs with "backport" label from master to v1.0.x #2265

Merged
merged 5 commits into from
Sep 14, 2016

Conversation

zhangkun83
Copy link
Contributor

@zhangkun83 zhangkun83 commented Sep 13, 2016

#2060 #2108 #2131 #2226 #2258

Manually resolved conflicts in 29fefe2 (#2226: core: split Context into a separate grpc-context artifact. )

ejona86 and others added 5 commits September 13, 2016 15:36
To my knowledge, there has been just a single DeadlineTest flake since
the code was fixed to avoid issues with I/O due to class loading:

io.grpc.DeadlineTest > defaultTickerIsSystemTicker[0] FAILED
    java.lang.AssertionError: <-21431071 ns from now> and <0 ns from now> should have been within <20000000ns> of each other

But we don't really need fine-grained verification during the test
though; if the code is not using nanoTime, then it is almost certainly
not going to have even a day of accuracy (except on a fresh VM). So
checking for a second of accuracy vs 20ms shouldn't really be an issue.
Implementations of ManagedClientTransport.start() are restricted from
calling the passed listener until start() returns, in order to avoid
reentrency problems with locks. For most transports this isn't a
problem, because they need additional threads anyway. InProcess uses no
additional threads naturally so ends up needing a thread just to
notifyReady. Now transports can just return a Runnable that can be run
after locks are dropped.

This was originally intended to be a performance optimization, but the
thread also causes nondeterminism because RPCs are delayed until
notifyReady is called. So avoiding the thread reduces needless fakes
during tests.
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.

Manually resolved conflicts:
	context/src/main/java/io/grpc/Context.java
	context/src/main/java/io/grpc/Deadline.java
	core/build.gradle
Honor the lock order that transport lock > channel lock.

Resolves grpc#2246
return reference;
}

private static class LogExceptionRunnable implements Runnable {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you could have just dropped it. It wasn't necessary to begin with (in c8648dc). This works too.

@ejona86
Copy link
Member

ejona86 commented Sep 13, 2016

@zhangkun83 LGTM

@zhangkun83 zhangkun83 merged commit 75863cd into grpc:v1.0.x Sep 14, 2016
@zhangkun83 zhangkun83 deleted the v1.0.x branch September 14, 2016 15:30
@zhangkun83 zhangkun83 restored the v1.0.x branch September 14, 2016 15:31
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants