From 80aa877263e8cea0f8694b7321359f38ae5a22c8 Mon Sep 17 00:00:00 2001 From: DiegoTavares Date: Wed, 4 Oct 2023 14:08:33 -0700 Subject: [PATCH] Fix merge conflicts --- .../spcue/dispatcher/FrameCompleteHandler.java | 1 + .../imageworks/spcue/dispatcher/HostReportHandler.java | 10 ++-------- .../commands/DispatchRqdKillFrameMemory.java | 6 ++++-- .../spcue/test/dispatcher/HostReportHandlerTests.java | 6 +++--- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/FrameCompleteHandler.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/FrameCompleteHandler.java index 6e2653ac8..c405a9e31 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/FrameCompleteHandler.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/FrameCompleteHandler.java @@ -33,6 +33,7 @@ import com.imageworks.spcue.DispatchFrame; import com.imageworks.spcue.DispatchHost; import com.imageworks.spcue.DispatchJob; +import com.imageworks.spcue.FrameDetail; import com.imageworks.spcue.JobDetail; import com.imageworks.spcue.LayerDetail; import com.imageworks.spcue.LayerInterface; diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java index a1dc007af..933789fc0 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/HostReportHandler.java @@ -30,6 +30,7 @@ import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.imageworks.spcue.JobInterface; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.LogManager; import org.springframework.beans.factory.annotation.Autowired; @@ -44,7 +45,6 @@ import com.imageworks.spcue.JobEntity; import com.imageworks.spcue.LayerEntity; import com.imageworks.spcue.LayerDetail; -import com.imageworks.spcue.FrameDetail; import com.imageworks.spcue.LocalHostAssignment; import com.imageworks.spcue.Source; import com.imageworks.spcue.VirtualProc; @@ -54,6 +54,7 @@ import com.imageworks.spcue.dispatcher.commands.DispatchBookHostLocal; import com.imageworks.spcue.dispatcher.commands.DispatchHandleHostReport; import com.imageworks.spcue.dispatcher.commands.DispatchRqdKillFrame; +import com.imageworks.spcue.dispatcher.commands.DispatchRqdKillFrameMemory; import com.imageworks.spcue.grpc.host.HardwareState; import com.imageworks.spcue.grpc.host.LockState; import com.imageworks.spcue.grpc.report.BootReport; @@ -567,11 +568,6 @@ private boolean getKillClearance(String hostname, String frameId) { if (!dispatcher.isTestMode()) { FrameInterface frame = jobManager.getFrame(frameId); JobInterface job = jobManager.getJob(frame.getJobId()); - prometheusMetrics.incrementFrameKillFailureCounter( - hostname, - job.getName(), - frame.getName(), - frameId); } return false; } @@ -592,7 +588,6 @@ private boolean killProcForMemory(VirtualProc proc, String hostname, KillCause k try { killQueue.execute(new DispatchRqdKillFrameMemory(hostname, frame, killCause.toString(), rqdClient, dispatchSupport, dispatcher.isTestMode())); - prometheusMetrics.incrementFrameKilledCounter(hostname, killCause); } catch (TaskRejectedException e) { logger.warn("Unable to add a DispatchRqdKillFrame request, task rejected, " + e); return false; @@ -616,7 +611,6 @@ private boolean killFrame(String frameId, String hostname, KillCause killCause) frameId, killCause.toString(), rqdClient)); - prometheusMetrics.incrementFrameKilledCounter(hostname, killCause); } catch (TaskRejectedException e) { logger.warn("Unable to add a DispatchRqdKillFrame request, task rejected, " + e); } diff --git a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/commands/DispatchRqdKillFrameMemory.java b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/commands/DispatchRqdKillFrameMemory.java index 53aff120e..f50017361 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dispatcher/commands/DispatchRqdKillFrameMemory.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dispatcher/commands/DispatchRqdKillFrameMemory.java @@ -24,11 +24,13 @@ import com.imageworks.spcue.dispatcher.DispatchSupport; import com.imageworks.spcue.rqd.RqdClient; import com.imageworks.spcue.rqd.RqdClientException; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + public class DispatchRqdKillFrameMemory extends KeyRunnable { - private static final Logger logger = Logger.getLogger(DispatchRqdKillFrameMemory.class); + private static final Logger logger = LogManager.getLogger(DispatchRqdKillFrameMemory.class); private String message; private String hostname; diff --git a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java index 25499406d..971df8d14 100644 --- a/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java +++ b/cuebot/src/test/java/com/imageworks/spcue/test/dispatcher/HostReportHandlerTests.java @@ -486,7 +486,7 @@ public void testMemoryAggressionRss() { .build(); long killCount = DispatchSupport.killedOffenderProcs.get(); - hostReportHandler.handleHostReport(report, false, System.currentTimeMillis()); + hostReportHandler.handleHostReport(report, false); assertEquals(killCount + 1, DispatchSupport.killedOffenderProcs.get()); } @@ -523,7 +523,7 @@ public void testMemoryAggressionMaxRss() { .build(); long killCount = DispatchSupport.killedOffenderProcs.get(); - hostReportHandler.handleHostReport(report, false, System.currentTimeMillis()); + hostReportHandler.handleHostReport(report, false); assertEquals(killCount + 1, DispatchSupport.killedOffenderProcs.get()); } @@ -586,7 +586,7 @@ public void testMemoryAggressionMemoryWarning() { // In this case, killing one job should be enough to ge the machine to a safe state long killCount = DispatchSupport.killedOffenderProcs.get(); - hostReportHandler.handleHostReport(report, false, System.currentTimeMillis()); + hostReportHandler.handleHostReport(report, false); assertEquals(killCount + 1, DispatchSupport.killedOffenderProcs.get()); // Confirm the frame will be set to retry after it's completion has been processed