Skip to content

Commit

Permalink
fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Jun 7, 2024
1 parent f20e53b commit d4d397f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/ai/backend/agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ async def sync_and_get_kernels(
and return kernel infos whose status is irreversible.
"""

actual_terminating_kernels: list[tuple[KernelId, KernelLifecycleEventReason]] = []
actual_terminated_kernels: list[tuple[KernelId, KernelLifecycleEventReason]] = []
actual_terminating_kernels: list[tuple[KernelId, str]] = []
actual_terminated_kernels: list[tuple[KernelId, str]] = []

async with self.agent.registry_lock:
actual_existing_kernels = [
Expand All @@ -507,13 +507,15 @@ async def sync_and_get_kernels(
if kernel_id in self.agent.terminating_kernels:
actual_terminating_kernels.append((
kernel_id,
kernel_obj.termination_reason
or KernelLifecycleEventReason.ALREADY_TERMINATED,
str(
kernel_obj.termination_reason
or KernelLifecycleEventReason.ALREADY_TERMINATED
),
))
else:
actual_terminated_kernels.append((
kernel_id,
KernelLifecycleEventReason.ALREADY_TERMINATED,
str(KernelLifecycleEventReason.ALREADY_TERMINATED),
))

for raw_kernel_id in terminating_kernels:
Expand All @@ -531,7 +533,7 @@ async def sync_and_get_kernels(
else:
actual_terminated_kernels.append((
kernel_id,
KernelLifecycleEventReason.ALREADY_TERMINATED,
str(KernelLifecycleEventReason.ALREADY_TERMINATED),
))

for kernel_id, kernel_obj in self.agent.kernel_registry.items():
Expand Down

0 comments on commit d4d397f

Please sign in to comment.