Skip to content

Commit b4139d2

Browse files
committed
improve logs
1 parent e4fc89b commit b4139d2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

services/autoscaling/src/simcore_service_autoscaling/modules/cluster_scaling/_auto_scaling_core.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,8 @@ def _try_assign_task_to_ec2_instance(
575575
_logger.debug(
576576
"%s",
577577
f"assigned task with {task_required_resources=}, {task_required_ec2_instance=} to "
578-
f"{instance.ec2_instance.id=}:{instance.ec2_instance.type}, "
579-
f"remaining resources:{instance.available_resources}/{instance.ec2_instance.resources}",
578+
f"{instance.ec2_instance.id=}:{instance.ec2_instance.type=}, "
579+
f"{instance.available_resources=}, {instance.ec2_instance.resources=}",
580580
)
581581
return True
582582
return False
@@ -599,8 +599,8 @@ def _try_assign_task_to_ec2_instance_type(
599599
_logger.debug(
600600
"%s",
601601
f"assigned task with {task_required_resources=}, {task_required_ec2_instance=} to "
602-
f"{instance.instance_type}, "
603-
f"remaining resources:{instance.available_resources}/{instance.instance_type.resources}",
602+
f"{instance.instance_type=}, "
603+
f"{instance.available_resources=}, {instance.instance_type.resources=}",
604604
)
605605
return True
606606
return False
@@ -1217,7 +1217,10 @@ async def _scale_down_unused_cluster_instances(
12171217
) -> Cluster:
12181218
if any(not instance.has_assigned_tasks() for instance in cluster.active_nodes):
12191219
# ask the provider to try to retire nodes actively
1220-
with log_catch(_logger, reraise=False):
1220+
with (
1221+
log_catch(_logger, reraise=False),
1222+
log_context(_logger, logging.INFO, "actively ask to retire unused nodes"),
1223+
):
12211224
await auto_scaling_mode.try_retire_nodes(app)
12221225
cluster = await _deactivate_empty_nodes(app, cluster)
12231226
return await _try_scale_down_cluster(app, cluster)

0 commit comments

Comments
 (0)