Skip to content

Commit 659d5f9

Browse files
fmeumcopybara-github
authored andcommitted
Add profiler span for sending the Execute request
We are seeing profiles in which there is a large gap between the start of the `execute remotely` span and the the start of the `queue` span reported by the remote executor. The current theory is that there is contention on the channel with async tasks spawned by `--remote_cache_async` which this span could help pin down. Closes bazelbuild#25947. PiperOrigin-RevId: 753068760 Change-Id: I2b004152ab695530d02d160b8c7b446fcc89e60f
1 parent d2b1215 commit 659d5f9

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteExecutor.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
import com.google.common.base.Preconditions;
2525
import com.google.devtools.build.lib.authandtls.CallCredentialsProvider;
2626
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
27+
import com.google.devtools.build.lib.profiler.Profiler;
28+
import com.google.devtools.build.lib.profiler.ProfilerTask;
29+
import com.google.devtools.build.lib.profiler.SilentCloseable;
2730
import com.google.devtools.build.lib.remote.common.OperationObserver;
2831
import com.google.devtools.build.lib.remote.common.RemoteActionExecutionContext;
2932
import com.google.devtools.build.lib.remote.common.RemoteExecutionClient;
@@ -165,11 +168,15 @@ public ExecuteResponse executeRemotely(
165168
execBlockingStub(context.getRequestMetadata(), channel)
166169
.waitExecution(wr));
167170
} else {
168-
replies =
169-
channel.withChannelBlocking(
170-
channel ->
171-
execBlockingStub(context.getRequestMetadata(), channel)
172-
.execute(request));
171+
try (SilentCloseable c =
172+
Profiler.instance()
173+
.profile(ProfilerTask.REMOTE_EXECUTION, "send Execute request")) {
174+
replies =
175+
channel.withChannelBlocking(
176+
channel ->
177+
execBlockingStub(context.getRequestMetadata(), channel)
178+
.execute(request));
179+
}
173180
}
174181
try {
175182
while (replies.hasNext()) {

0 commit comments

Comments
 (0)