Skip to content

Conversation

@zpencer
Copy link
Contributor

@zpencer zpencer commented Jan 4, 2018

Instead, pass a ServerCallInfo object containing the interesting bits
of info. This lets us modify the call handler for binary logging, but
still provide the original info to the StatsTraceContext API.

Updated unit tests and existing code to use new API
Modified existing tests that were overspecified, and failed because of new but harmless mock interactions.

Instead, pass a ServerCallInfo object containing the interesting bits
of info. This lets us modify the call handler for binary logging, but
still provide the original info to the StatsTraceContext API.
@zpencer zpencer requested a review from zhangkun83 January 4, 2018 17:36
@zpencer
Copy link
Contributor Author

zpencer commented Jan 4, 2018

This PR is required for #3879

@zpencer
Copy link
Contributor Author

zpencer commented Jan 9, 2018

@zhangkun83 PTAL

* handler.
*/
@SuppressWarnings("deprecation")
public void serverCallStarted(final ServerCallInfo<?, ?> callInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Argument doesn't need to be final.

public boolean isCancelled() {
return isCancelled;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

ServerCallInfo is passed only to serverCallStarted(). isReady() and isCancelled() don't seem to be useful at that point. We should probably remove them.

@zhangkun83 zhangkun83 self-assigned this Jan 17, 2018
@zpencer zpencer added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Jan 25, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label Jan 25, 2018
@zpencer
Copy link
Contributor Author

zpencer commented Jan 25, 2018

@zhangkun83 ping

The GAE failure is due to an unrelated issue #4000

private final Attributes attributes;
private final String authority;

ServerCallInfo(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... if you lock down the constructor, how do people outside of gRPC unit-test their own ServerStreamTracers?

Maybe this should be an abstract class, and put the impl in io/grpc/internal.

/**
* An implementation of {@link ServerCallInfo}.
*/
public final class ServerCallInfoImpl<ReqT, RespT> extends ServerCallInfo<ReqT, RespT> {
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be package-private.

@zpencer zpencer merged commit 0465bb5 into grpc:master Jan 27, 2018
@zpencer zpencer deleted the stats-trace-context-no-servercall branch January 27, 2018 00:51
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 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.

3 participants