diff --git a/sched/adaptdl_sched/allocator.py b/sched/adaptdl_sched/allocator.py index 3f30fbf5..4c803693 100644 --- a/sched/adaptdl_sched/allocator.py +++ b/sched/adaptdl_sched/allocator.py @@ -59,7 +59,10 @@ async def _allocate_one_loop(self): async for event in watch.stream( self._objs_api.list_namespaced_custom_object, *self._custom_resource, timeout_seconds=60): - if event["type"] == "ADDED": # there is a n arriving job + # We only consider newly-added preemptible jobs + # because this allocation may not be final. + if (event["type"] == "ADDED" and + event["object"]["spec"]["preemptible"]): async with self._lock: await self._allocate_one(event)