Skip to content

Commit fbde9df

Browse files
authored
Fix _check_instance log spam (#2956)
1 parent 28012cf commit fbde9df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/dstack/_internal/server/background/tasks/process_instances.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@ async def _check_instance(session: AsyncSession, instance: InstanceModel) -> Non
800800
health_status = instance.health
801801

802802
loglevel = logging.DEBUG
803-
if not instance_check.reachable or (check_instance_health and not health_status.is_healthy()):
803+
if not instance_check.reachable and instance.status.is_available():
804+
loglevel = logging.WARNING
805+
elif check_instance_health and not health_status.is_healthy():
804806
loglevel = logging.WARNING
805807
logger.log(
806808
loglevel,
@@ -945,7 +947,7 @@ def _check_instance_inner(
945947
except requests.RequestException as e:
946948
template = "shim.%s(): request error: %s"
947949
args = (method.__func__.__name__, e)
948-
logger.warning(template, *args)
950+
logger.debug(template, *args)
949951
return InstanceCheck(reachable=False, message=template % args)
950952
except Exception as e:
951953
template = "shim.%s(): unexpected exception %s: %s"

0 commit comments

Comments
 (0)