Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make finish-reset swap repos without a gap

Aperta
#30 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend

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: cancellationToken is 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sillsdev/hgresume

Tutte le issue di sillsdev/hgresume

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.