trustPackedRefsStat=after_open does not work reliably
@klingarkar y travaille déjà.
Depuis le 15/6/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
Piste de recherche
Start with RefDirectory's AFTER_OPEN refresh path and FileSnapshot.isModified(), which the issue identifies as the decision point; review the reproduction steps using RepositoryCache and PackedBatchRefUpdate to understand the NFS scenario. Done means a reader configured with trustPackedRefsStat=after_open reliably notices packed-refs replacements and re-reads the refs; the issue names no test file, so first locate the relevant packed-refs refresh tests.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Version
6.10
Operating System
Linux/Unix
Bug description
On an NFS-backed repository shared by multiple hosts, a reading host can fail to observe updates to packed-refs made by a writing host, even when core.trustPackedRefsStat=after_open is configured.
RefDirectory's AFTER_OPEN refresh opens the packed-refs file itself to force the NFS client to refresh cached attributes before FileSnapshot.isModified() decides whether to re-read it. This is insufficient in the following scenario:
On NFS, updating packed-refs replaces the file by atomically swapping in a new inode under the same name. If the previous packed-refs is still held open on a host when the swap occurs, NFS preserves the old inode as a hidden .nfsXXXX entry instead of deleting it (silly-rename). In this state, a reading host can keep resolving/observing the stale inode, and opening+closing the packed-refs file does not reliably trigger an attribute refresh. As a result, isModified() compares against stale attributes, concludes nothing changed, and the reader skips re-reading, so refs written on the writing host go unnoticed.
Actual behavior
With AFTER_OPEN configured, after a writing host updates packed-refs, a reading host may not detect that packed-refs was updated and read stale refs.
Expected behavior
After a writing host updates packed-refs, a reading host with AFTER_OPEN configured should always detect that packed-refs has changed and re-read it.
Relevant log output
Other information
This can possibly be reproduced by:
Reader
- Open a repo (with trustPackedRefsStat=after_open configured) via JGit RepositoryCache
- Start a reader thread which calls getRefDatabase().getRefs() in a loop
- Print any added/changed refs whenever a change in refs is detected
Writer
- Open the same repo's packed-refs file once in a thread and keep it open for the whole test run
- Repeat below for a few iterations:
- Open the repo via RepositoryCache
- Create a new commit
- Generate couple of randomly named refs
- Write both refs atomically using PackedBatchRefUpdate
- Sleep 1-2s before the next iteration
- After all iterations, stop the packed-refs holder thread
- Langage dominant
- Java
- Étoiles
- 427
- Forks
- 116
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de eclipse-jgit/jgit
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
eclipse-jgit/jgit#329 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()Peut-être à nouveau libre @hardikyadav12 l’a pris il y a 77 jours, et aucune pull request n’est ouverte. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
eclipse-jgit/jgit#297 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
eclipse-jgit/jgit#293 · 2 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
eclipse-jgit/jgit#288 ·
Toutes les issues de eclipse-jgit/jgit
Issues similaires
-
? - Needs Triage bot_watch bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
NVIDIA/cudf-spark-jni#5594 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Upgrade solr to 9.11.0Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
DataONEorg/dataone-indexer#390 ·