diff --git a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java index bb667fcd0..80fe18f0f 100644 --- a/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java +++ b/src/main/java/build/buildfarm/worker/shard/CFCExecFileSystem.java @@ -40,6 +40,7 @@ import build.buildfarm.cas.ContentAddressableStorage; import build.buildfarm.cas.cfc.CASFileCache; import build.buildfarm.common.BuildfarmExecutors; +import build.buildfarm.common.DigestUtil; import build.buildfarm.common.io.Directories; import build.buildfarm.common.io.Dirent; import build.buildfarm.worker.ExecDirException; diff --git a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java index ba9f3d9a5..8db3874f8 100644 --- a/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java +++ b/src/main/java/build/buildfarm/worker/shard/RemoteCasWriter.java @@ -81,8 +81,6 @@ private void insertFileToCasMember(Digest digest, DigestFunction.Value digestFun } } - private long writeToCasMember(Digest digest, InputStream in) - throws IOException, InterruptedException { private long writeToCasMember(Digest digest, DigestFunction.Value digestFunction, InputStream in) throws IOException, InterruptedException { // create a write for inserting into another CAS member. diff --git a/src/main/java/build/buildfarm/worker/shard/Worker.java b/src/main/java/build/buildfarm/worker/shard/Worker.java index 0548f1351..434872e67 100644 --- a/src/main/java/build/buildfarm/worker/shard/Worker.java +++ b/src/main/java/build/buildfarm/worker/shard/Worker.java @@ -97,11 +97,6 @@ import javax.annotation.Nullable; import javax.naming.ConfigurationException; import lombok.extern.java.Log; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.ApplicationContext; -import org.springframework.context.annotation.ComponentScan; @Log public final class Worker extends LoggingMain { @@ -146,7 +141,6 @@ public final class Worker extends LoggingMain { private LoadingCache workerStubs; private AtomicBoolean released = new AtomicBoolean(true); - @Autowired private ApplicationContext springContext; /** * The method will prepare the worker for graceful shutdown when the worker is ready. Note on * using stderr here instead of log. By the time this is called in PreDestroy, the log is no @@ -227,10 +221,9 @@ public void run() { // Consider defining exit codes to better afford out of band instance // recovery - int code = SpringApplication.exit(springContext, () -> 1); termFuture.cancel(false); shutdownDeadlineExecutor.shutdown(); - System.exit(code); + System.exit(0); } private Operation stripOperation(Operation operation) { diff --git a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java index 5834ab1a8..4a3c864b2 100644 --- a/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java +++ b/src/test/java/build/buildfarm/common/services/WriteStreamObserverTest.java @@ -115,6 +115,7 @@ public void noErrorWhenContextCancelled() throws Exception { when(instance.getBlobWrite( eq(Compressor.Value.IDENTITY), eq(cancelledDigest), + eq(DigestFunction.Value.UNKNOWN), eq(uuid), any(RequestMetadata.class))) .thenReturn(write); @@ -137,6 +138,7 @@ public void noErrorWhenContextCancelled() throws Exception { .getBlobWrite( eq(Compressor.Value.IDENTITY), eq(cancelledDigest), + eq(DigestFunction.Value.UNKNOWN), eq(uuid), any(RequestMetadata.class)); verifyNoInteractions(responseObserver); diff --git a/src/test/java/build/buildfarm/worker/PipelineTest.java b/src/test/java/build/buildfarm/worker/PipelineTest.java index 0901f4dad..209f81ca4 100644 --- a/src/test/java/build/buildfarm/worker/PipelineTest.java +++ b/src/test/java/build/buildfarm/worker/PipelineTest.java @@ -110,7 +110,7 @@ public void stageExitsOnInterrupt() throws InterruptedException { Pipeline pipeline = new Pipeline(); TestStage stage = new TestStage("test"); pipeline.add(stage, 1); - pipeline.start(); + pipeline.start(null); pipeline.join(); } @@ -147,7 +147,7 @@ public void stageContinuesOnException() throws InterruptedException { Pipeline pipeline = new Pipeline(); ContinueStage stage = new ContinueStage("test"); pipeline.add(stage, 1); - pipeline.start(); + pipeline.start(null); boolean didNotThrow = false; try {