fix: mount-list dedup (BA-650 / #3593) regressed in SessionSpec refactor — KernelRow.mounts no longer deduped at enqueue

Open Beginner friendly
#12,348 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
79/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api, backend

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 ...}]:

  1. Read pathmodels/session.py :: parse_row (GraphQL session resolver)
  2. Write pathregistry.py :: enqueue_session (persisted KernelRow.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.mounts column can again contain duplicate folder names — the exact condition #3593 fixed.
  • User-facing GraphQL responses are NOT affected: parse_row re-derives mounts from vfolder_mounts with dedup at read time, so compute_session / compute_session_list still return unique values.
  • Any consumer that reads the stored mounts column without going through parse_row would 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lablup/backend.ai

All issues in lablup/backend.ai

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.