From 2b919f787c353364254e5e4a3b932766c78c7f86 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Wed, 6 Nov 2024 13:42:44 +0100 Subject: [PATCH] Fixed small problem with tasks that are too large to schedule never finishing. --- .../org/opendc/compute/simulator/service/ComputeService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java index b6a69209f..c7478c841 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java +++ b/opendc-compute/opendc-compute-simulator/src/main/java/org/opendc/compute/simulator/service/ComputeService.java @@ -463,10 +463,13 @@ private void doSchedule() { // Remove the incoming image taskQueue.poll(); tasksPending--; + tasksTerminated++; LOGGER.warn("Failed to spawn {}: does not fit", task); - task.setState(TaskState.FAILED); + task.setState(TaskState.TERMINATED); + + this.setTaskToBeRemoved(task); continue; } else { break;