From 4e8ca5d246d72e16a8adaf02ccf4ac02f23977c8 Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Wed, 6 Nov 2024 14:02:10 +0100 Subject: [PATCH] Fixed small problem with tasks that are too large to schedule never finishing. (#264) --- .../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;