Prevent two exports to the same archive path
Maintainer thường phản hồi trong vòng 1 ngày
@ArpitaSamanta10 đang làm issue này rồi.
Từ ngày 19/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
Start with morango/sync/archive.py and morango/errors.py, then read pid_exists in morango/utils.py and its use in morango/sync/syncsession.py. Add the lock and exception behavior described for create, finalize, and discard, and patch morango.sync.archive.pid_exists in tests. Done means the live/dead process cases, lock-file cleanup, error path, and Windows tox environment all pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Overview
A lock file stops two processes from writing to the same archive path at the same time. This work is part of milestone M5.
Background & Motivation
Archive.create replaces a stale partial file. Without a lock, it cannot tell a stale file from a file that another export writes at the same time. A lock file that holds the process id solves this. Morango uses the same process check to resume sync sessions.
Design: spec. Plan: implementation plan, Task 18.
Description & Expected Outcomes
Archive.create makes <path>.lock with an exclusive create, and writes its process id into it. If the lock file exists and its process is alive, create raises MorangoArchiveLocked. If the process is not alive, the lock is stale, and create replaces it. finalize and discard delete the lock file.
Deliverables & Contracts
The change delivers these capabilities:
- The error
MorangoArchiveLocked, a subclass ofMorangoArchiveError. - Lock handling in
Archive.create,Archive.finalize, andArchive.discard. - An error message that names the lock file, so that an operator can remove it.
Acceptance Criteria
- A lock file with the id of a live process from another program makes
createraiseMorangoArchiveLocked. - A lock file with the id of a dead process is replaced, and
createsucceeds. - After
discard, no<path>.lockfile remains. - The error message contains the path of the lock file.
- The lock tests also run in the
windowstox environment.
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/archive.py,morango/errors.py. - Related Patterns:
pid_existsinmorango/utils.py, used byresume_sync_sessionatmorango/sync/syncsession.py:304-312. - Data Model & Schema Considerations: None.
- Resilience & Failure Modes: If the operating system reuses a process id,
createcan report a false lock. The error message names the lock file for this case.
Notes & Tradeoffs
- Dependencies: Blocked by: #378 (
Archive.createanddiscard). Blocks: #382. - Testing Requirements: Patch
morango.sync.archive.pid_existsto control whether the process is alive. - Tradeoffs & Alternatives Considered: Operating system file locks do not work the same on all platforms. A lock file with a process id works on Linux, macOS, and Windows.
- Compatibility & Migrations: None.
Metadata
- Complexity: Low
- Target Branch: release-v0.9.x
AI Usage
Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.
- Ngôn ngữ chính
- Python
- Star
- 15
- Fork
- 27
- Merge trung bình
- 6 ngày 44 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của learningequality/morango
-
Document disk export and deprecations in the changelogCó thể làm lại được @ArpitaSamanta10 đã nhận 14 ngày trước và không có pull request nào đang mở. Đang mởDEV: dev-ops DEV: distributions DOCS: developer
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/morango#387 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend DEV: dev-ops TAG: unit tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
learningequality/morango#385 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 54/100
learningequality/morango#425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 1/100
learningequality/morango#424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend P2 - normal
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
learningequality/morango#416 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của learningequality/morango
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Có thể đã có người làm @cestercian đã nhận hôm nay. Đang mởcomp/cli P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#162259 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[request] gRpc/1.86.0Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
conan-io/conan-center-index#31597 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AOSSIE-Org/PictoPy#1802 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
community-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer thường phản hồi trong vòng 1 ngày