Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ private static final class ServerTracer extends ServerStreamTracer {
this.fullMethodName = fullMethodName;
this.streamPlugins = checkNotNull(streamPlugins, "streamPlugins");
this.stopwatch = module.stopwatchSupplier.get().start();
isGeneratedMethod = fullMethodName != null;
Copy link
Contributor

Choose a reason for hiding this comment

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

This overrides early the reasoning specified in serverCallStarted but only till serverCallStarted is called. There will be higher cardinality metrics only in the small number of cases where the stream is closed before the server call is started.
@ejona86

Copy link
Member

Choose a reason for hiding this comment

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

An attacker has control of whether the stream is closed before the server call is started.

I'm not sure there's anything to do to fix that issue, except maybe by making some processing occur in a certain order in the case of cancellation.

Copy link
Member

Choose a reason for hiding this comment

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

This != null check is also garbage. It is guaranteed to be non-null (see CallAttemptsTracerFactory's constructor), so this is the same as isGeneratedMethod = true

}

@Override
Expand Down
Loading