Make finish-reset swap repos without a gap
还没有人认领这个 Issue。
评估
调研方向
Start in FinishReset, where DeleteRepoIfExists runs before tempRepo.MoveTo(PrefixRepoFilePath(code)). Check how _____temp_____ and the live repo path are built, and how cancellation is checked between the steps. Done means the live repo is moved aside before the new one is moved in, the old copy is deleted only as best effort, and the cancellation behaviour during the swap is settled. Confirm the change with a test that makes the delete fail partway. The issue does not settle the cancellation question, so ask the maintainers before choosing.
由索引模型根据 Issue 内容生成。
描述
FinishReset replaces the live repo in two steps:
await DeleteRepoIfExists(code, cancellationToken); // recursive delete of the live repo
tempRepo.MoveTo(PrefixRepoFilePath(code)); // then move the new one in
Consequences:
- Brief window: between the two calls the repo doesn't exist, so concurrent hgweb/resumable requests for that code get a 404 or a partially deleted repo. A recursive delete of a large repo on NFS can take a while.
- Possible permanent loss: if the delete throws partway through, for example because a file is held open, the request fails with a partially deleted live repo and the new content still in
_____temp_____. - Cancellation:
cancellationTokenis checked between steps, so an aborted request can stop after the delete and before the move.
Suggestion: move the live repo aside first, e.g. Directory.Move into _____temp_____/{code}__replaced__{ts}, which is a cheap rename on the same volume. Then move the new repo into place, and delete the old one afterwards (best effort). That shrinks the gap to two renames and means the old data is never lost before the new data is in place. Also consider not honouring cancellation once the swap has started.
Same caveat as the temp-dir leak: this was ported from LexBox HgService, so the current LexBox behaviour is the same.
- 主要语言
- C#
- 星标
- 0
- 派生
- 1
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 2
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sillsdev/hgresume 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 半天 新手友好度 72/100
-
难度 1/5 1 小时以内 新手友好度 50/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 35/100
查看 sillsdev/hgresume 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 76/100
GameShowLDA/AskMkiM#1075 ·
维护者通常 1 天内回复
-
kind/bug triage/untriaged
难度 2/5 1-3 小时 新手友好度 78/100
unoplatform/uno.resizetizer#414 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复