fix: discovery indexes the files of an index directory that a .codegraph link points to inside the repository

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
64/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
search

Direzione di ricerca

Start by tracing file discovery and checking how query.IndexDirs reports the resolved index directory. Reproduce the race with a .codegraph link to cg-real while repeatedly running the indexing command. Done means discovery skips the resolved index directory and its store, and indexing no longer reads live store files.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:indexer bug needs-triage
What happens

Found while reviewing PR #374, which relates to #372. A test in #374 failed in 1 of 26 runs with this error, before its fixture was renamed:

lstat .../cg-real/store/OPTIONS-000008

File discovery skips .codegraph by name and skips names that start with a dot. It does not know that cg-real is the index. So it walks into the live Pebble store in cg-real/store. Discovery then races with Pebble's own file renames and deletes. The run can fail, or it can index store files.

What you expected instead

Discovery skips the resolved index directory and its store, as query.IndexDirs reports them, whatever their names are. Indexing through a .codegraph link to cg-real leaves the live store unread.

Steps to reproduce
  1. Create a repository with a directory named cg-real that holds the index.
  2. Link the index: ln -s cg-real .codegraph.
  3. Run the indexing command repeatedly. The failure appeared in 1 of 26 runs.

A workaround is to name the link target with a leading dot, such as .cg-real. Discovery then skips it by name.

Version

Built from source at main.

Platform

macOS.

How did you install it?

Built from source

Languages in the affected repository

All languages.

Before submitting
  • I searched existing issues and this is not a duplicate
  • I checked the capability matrix and this is not a documented limitation
  • This is not a security vulnerability
Lingua principale
Go
Stelle
0
Fork
0
Merge medio
7h 42m
PR unite (30g)
111

Preparare l'ambiente

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 seanb4t/codegraph-go

Tutte le issue di seanb4t/codegraph-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.