fix: mount-list dedup (BA-650 / #3593) regressed in SessionSpec refactor — KernelRow.mounts no longer deduped at enqueue
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
Research direction
Read src/ai/backend/manager/repositories/scheduler/creators.py at SessionRowCreator.build_row, especially the resolved_mounts assignment and KernelRow.mounts construction. Compare it with the original deduplication in #3593, then check the legacy registry.py:1075 enqueue path for the same gap. Done means persisted mounts are deduplicated in both write paths; user-facing GraphQL behavior is already described as unaffected.
Written by the indexing model from the issue text.
Description
Summary
The mount-list deduplication added in #3593 (BA-650) was partially lost during the sokovan session-lifecycle / SessionSpec refactor (#11250). The write/enqueue path no longer deduplicates mounts before persisting it to KernelRow.
Background
#3593 deduped the compute-session mount list in two places, both via a set-comprehension [*{mount.name for mount in ...}]:
- Read path —
models/session.py :: parse_row(GraphQL session resolver) - Write path —
registry.py :: enqueue_session(persistedKernelRow.mounts)
Current state (main, after #11250)
Read path — still correct, even strengthened. Now at src/ai/backend/manager/api/gql_legacy/session.py:1103:
"mounts": [*{mount.name for mount in vfolder_mounts}],
"vfolder_mounts": [*{vf.vfid.folder_id for vf in vfolder_mounts}], # newly deduped too
Write path — regressed. The enqueue_session payload was refactored into SessionRowCreator.build_row, and the set-dedup was dropped. src/ai/backend/manager/repositories/scheduler/creators.py:110:
resolved_mounts = list(self.kernel_spec.vfolder_mounts)
...
mounts=[mount.name for mount in resolved_mounts], # ← no dedup (was [*{...}])
Impact
- The persisted
KernelRow.mountscolumn can again contain duplicate folder names — the exact condition #3593 fixed. - User-facing GraphQL responses are NOT affected:
parse_rowre-derivesmountsfromvfolder_mountswith dedup at read time, socompute_session/compute_session_liststill return unique values. - Any consumer that reads the stored
mountscolumn without going throughparse_rowwould observe the duplicates.
Suggested fix
Restore the set-comprehension at the write site to match #3593:
mounts=[*{mount.name for mount in resolved_mounts}],
The legacy registry.py enqueue path (registry.py:1075, mounts=mount_entries built by _mount_entries_from_creation_config) should be checked for the same gap while at it.
References
- Original fix: #3593 (BA-650)
- Regressing refactor: #11250 (
8321c79aa,creators.py:110)
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 20h 35m
- Merged PRs (30d)
- 429
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lablup/backend.ai
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
lablup/backend.ai#14890 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
lablup/backend.ai#14886 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lablup/backend.ai#14485 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lablup/backend.ai#14101 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
lablup/backend.ai#14080 ·
All issues in lablup/backend.ai
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100