Make finish-reset swap repos without a gap
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 0
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sillsdev/hgresume
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 50/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di sillsdev/hgresume
Issue simili
-
[Bug] Dashboard renders attachment links that resolve to 404 when the FILES binding is absentApertabug 優先: 低
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
.NET area: storage bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Larson-Logan/medal-sync#61 ·
I maintainer di solito rispondono entro 1 giorno
-
area-ai bug untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
dotnet/extensions#7893 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100