Avoid unnecessary cleanup work in RemoteModule if possible
@@ -900,8 +900,10 @@ public final class RemoteModule extends BlazeModule {
RemoteActionContextProvider actionContextProviderRef = actionContextProvider;
TempPathGenerator tempPathGeneratorRef = tempPathGenerator;
AsynchronousFileOutputStream rpcLogFileRef = rpcLogFile;
+ if (actionContextProviderRef != null || tempPathGeneratorRef != null || rpcLogFileRef != null) {
blockWaitingModule.submit(
() -> afterCommandTask(actionContextProviderRef, tempPathGeneratorRef, rpcLogFileRef));
+ }
buildEventArtifactUploaderFactoryDelegate.reset();
repositoryRemoteExecutorFactoryDelegate.reset();
