fix: swap and writer lock files differ when one store is opened under two letter cases
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with internal/graphstore/locks.go at lockBesideOnce and internal/graphstore/shared.go at resolveStorePath and sharedKey; compare how lock paths are formed with how the shared-handle table identifies a store. Read the locking changes in #339 and #324, then check the existing lock file tests for the required <store>.swap name. Done when handles opened through different letter cases on a case-insensitive macOS volume share exclusion for both lock files, with the existing lock name preserved.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
Not reproduced yet. This finding comes from reading the code, so the behavior below is derived, not observed.
lockBesideOnce (internal/graphstore/locks.go:47) builds the swap and writer lock path as resolveStorePath(dir) + suffix. resolveStorePath (internal/graphstore/shared.go) runs filepath.Abs and then realpath.Resolve. realpath.Resolve resolves symlinks but does not normalize letter case.
On a case-insensitive file system, which is the macOS default, /x/case/store and /x/CASE/store name one store. The lock paths become /x/case/store.swap and /x/CASE/store.swap. flock takes the lock on the file that the path opens. Whether the two spellings open one inode depends on the file system, so our code does not guarantee that the two handles exclude each other.
The shared-handle table does not have this gap. sharedKey (internal/graphstore/shared.go:119) keys on the device and inode of the resolved parent plus the base name. Commit a5ca60a9 fixed that for #324.
The gap comes from the fix for #339 in commit 990b6499. Related: #339, #324, #286.
What you expected instead
One store has one swap lock and one writer lock, whatever letter case opens it. While the first handle is open, a second open or a ReplaceStore through the other spelling waits or returns ErrStoreLocked.
The fix has a constraint. The lock file must keep the name <store>.swap beside the store, because older releases and existing tests look for it there. An inode-based name is not an option. The fix needs the canonical on-disk spelling of the path, for example F_GETPATH on macOS.
Steps to reproduce
Not run yet. The planned steps, on a case-insensitive volume:
- Build the binary from commit
990b6499. - Open a store at
/x/case/storewithgraphstore.Open(internal/graphstore/pebble_store.go:168) and keep the handle open. - From a second process, open the same store through
/x/CASE/store. - Check whether the second open waits or returns
ErrStoreLocked.
Version
Built from source at commit 990b6499. The output of codegraph version is not captured.
Platform
macOS, Darwin 27.2.0, on the default case-insensitive file system.
How did you install it?
Built from source.
Languages in the affected repository
Not applicable. The bug is in store path handling, not in language extraction.
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
- Lenguaje dominante
- Go
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 7 h 42 min
- PR fusionados (30 d)
- 111
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de seanb4t/codegraph-go
-
chore needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
seanb4t/codegraph-go#380 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
seanb4t/codegraph-go#379 ·
Los mantenedores suelen responder en 1 día
-
area:query chore needs-triage spec-needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
seanb4t/codegraph-go#377 ·
Los mantenedores suelen responder en 1 día
-
chore needs-triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
seanb4t/codegraph-go#362 ·
Los mantenedores suelen responder en 1 día
-
area:query bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
seanb4t/codegraph-go#355 ·
Los mantenedores suelen responder en 1 día
Todos los issues de seanb4t/codegraph-go
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
automated documentation maintenance
Dificultad 1/5 1-3 horas Aptitud para principiantes 75/100
github/gh-aw-mcpg#16717 ·
Los mantenedores suelen responder en 1 día
-
Docs: Recording rules pages don't say what happens to a recorded metric when its rule is deletedAbiertointernal
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
jesseduffield/lazygit#6229 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
prometheus/prometheus#20482 ·
Los mantenedores suelen responder en 2 días