Skip to content

Commit

Permalink
shut up about scaling down
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Oct 11, 2024
1 parent c8d230c commit 2b7712d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/levanter/utils/actor_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _adjust_pool_size(self):

# Schedule scale down if idle
elif num_pending_tasks == 0 and num_nonworking_actors > self._min_size:
if self._scale_down_task is None or self._scale_down_task.done():
if self._scale_down_task is None:
self._scale_down_task = asyncio.create_task(self._schedule_scale_down())

async def _schedule_scale_down(self):
Expand All @@ -142,8 +142,9 @@ async def _schedule_scale_down(self):
if self.num_pending_tasks == 0:
logger.info("Scaling down due to no pending tasks.")
self._scale_down(self._min_size)
self._scale_down_task = None
except asyncio.CancelledError:
logger.info("Scale down task was cancelled due to new activity.")
logger.debug("Scale down task was cancelled due to new activity.")

def _get_object_location(self, obj_ref: ray.ObjectRef) -> Optional[str]:
"""Get the location of the given object reference."""
Expand Down

0 comments on commit 2b7712d

Please sign in to comment.