Workspace can't be opened when a stopped change's article is replaced by a link, folder or FIFO
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reading Workspace.load and the recovery logic for .text-fetch/publishing-article.json, then trace the add_file replacement and removal paths described in the reproduction. Reproduce the stopped-process cases with a symlink, folder, FIFO, and broken link, and inspect how recovery handles staged versus published versions. The issue needs a decision on recovery behavior; done means the chosen behavior lets a workspace reopen and reports any lost article data clearly.
Written by the indexing model from the issue text.
Description
A workspace records each article change in .text-fetch/publishing-article.json and finishes it on the next write or open. Suppose the process stops partway through a change, and before the next open the article path named in that record is replaced by something that isn't an article. Every later open then raises WorkspaceError until someone deletes the record by hand.
This affects moves between valid/ and incomplete/, replacements in the same folder, and removals. It was found while reviewing the fix for #72. Main (d4e507e) behaves the same, and the #72 fix doesn't change it.
Repro
- Create a workspace with a PDF article saved as valid:
add_file("<old/>", "10.1/scan", "pdf", "s", True, "scan.jats.xml", pdf_sha1="abc"). - In a child process, call
add_file("<new/>", "10.1/new", "pdf", "s", False, "scan.jats.xml", pdf_sha1="abc"). Patchos.replaceso the process exits right after the rename ontopublishing-article.json, or after the rename that publishesincomplete/scan.jats.xml. - Replace
incomplete/scan.jats.xmlas in the table below. - Call
Workspace.load.
| Stopped after | incomplete/scan.jats.xml replaced by |
Every open |
|---|---|---|
| the record was written (new version staged) | a symbolic link out of the folder | WorkspaceError: Article path leaves the workspace |
| the new version was published | a folder, a FIFO or a broken link | WorkspaceError: Cannot recover missing workspace article |
| the new version was published | a symbolic link out of the folder | WorkspaceError: Article path leaves the workspace |
The same happens when the replacement is a link, folder or FIFO at the target of a same-folder replacement or of a removal.
Why this needs a decision
- Before publication the change can still be undone: discard the staged version and drop the record. The old article is untouched.
- After publication the new version is gone, so the record can't be finished. It can't be cleanly undone either: the record holds the new DOI records, not the old ones, and the old copy may already be deleted.
Options:
- Undo while the staged version exists. After publication, drop the record and rebuild the affected index entries and counts from the files on disk, reporting the DOIs that no longer have an article.
- Keep the error, but make it name the record to delete and say what deleting it loses.
- Leave it. Someone has to replace an article file between a stop and the next open.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 1h 1m
- Merged PRs (30d)
- 31
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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 lanl/text-fetch
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lanl/text-fetch#92 ·
Maintainers usually reply within 1 day
-
area:cli area:pdf enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lanl/text-fetch#84 ·
Maintainers usually reply within 1 day
-
area:config area:output area:sources enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
lanl/text-fetch#88 ·
Maintainers usually reply within 1 day
-
area:cli area:expansion area:fetch enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
lanl/text-fetch#87 ·
Maintainers usually reply within 1 day
-
area:config area:sources enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
lanl/text-fetch#86 ·
Maintainers usually reply within 1 day
Similar issues
-
[Bug]: streaming_end_of_stream_only guardrails rescan the whole stream on every chunk - blocks event loopPossibly taken A pull request linked to this issue is open or already merged. Openbug llm translation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
arith ascend bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
tile-ai/tilelang#5173 · 2 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
kind: for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
monumental-archive/.github#2284 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
TanbirRamim/open-source-radar#761 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ktwu01/benchmark-radar#1450 ·
Maintainers usually reply within 1 day