trustPackedRefsStat=after_open does not work reliably
@klingarkar já está trabalhando nisso.
Desde 15/6/2026.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Java
- Estrelas
- 427
- Forks
- 116
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de eclipse-jgit/jgit
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
eclipse-jgit/jgit#329 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
eclipse-jgit/jgit#327 ·
-
Repository.create(boolean bare) should provide a no-arg overload that uses isBare()Talvez livre de novo @hardikyadav12 assumiu há 77 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
eclipse-jgit/jgit#297 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
eclipse-jgit/jgit#293 · 2 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
eclipse-jgit/jgit#288 ·
Todas as issues de eclipse-jgit/jgit
Issues semelhantes
-
? - Needs Triage bot_watch bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NVIDIA/cudf-spark-jni#5594 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Upgrade solr to 9.11.0Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
DataONEorg/dataone-indexer#390 ·