lablup / lablup/backend.ai

Correct the preemption handler docstring about kernel teardown

Open Beginner friendly
#13,252 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

## Objective

Correct the `PreemptSessionsLifecycleHandler` class docstring, which states that both preemption branches mark the victim's kernels TERMINATING. Only the terminate branch does.

## Background

- `terminate` calls `mark_sessions_for_termination`, which moves the session and its kernels to TERMINATING under the preemption reason — the docstring is right here.
- `reschedule` calls `mark_sessions_status`, which the DB layer documents as moving only the session status. The kernels stand until `RescheduleSessionsLifecycleHandler` tears them down on a later tick, under a different reason.

The wording misleads a reader about the kernel-side contract of the preemption path, which matters because there is deliberately no kernel-side PREEMPTED status — kernel teardown rides the ordinary lifecycle and the preemption context lives in the status reason.

## Acceptance Criteria

- The docstring describes what each branch actually writes, and where kernel teardown happens for each.
- No behaviour change; lint and type check pass.

## References

- `src/ai/backend/manager/sokovan/scheduler/handlers/lifecycle/preempt_sessions.py`
- BEP-1055 Session Preemption

JIRA Issue: BA-7075

Contributor guide

Open the contributing guide

Research direction

Open src/ai/backend/manager/sokovan/scheduler/handlers/lifecycle/preempt_sessions.py and read the PreemptSessionsLifecycleHandler docstring alongside the terminate and reschedule branches. Update only the wording so it distinguishes session and kernel status writes and identifies the later reschedule handler teardown, then run lint and type checks to confirm no behavior changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.