[Bug] Unclosed files, pipes and SQLite connections reported by Python dev mode
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
This is a tracking issue; start with sub-issues #8122 and #8123, which contain the reproducers and specific leak findings. Set PYTHONDEVMODE=1 and run the relevant Python tests or gunittest suite to reproduce warnings. Done means both sub-issues are fixed and GRASS code produces no ResourceWarning.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
I made an agent (Claude Code) and asked it to find the places where we open a file or a socket and never close it. It built GRASS, then ran the pytest tests and the full gunittest testsuite (with the NC sample dataset, as in the Ubuntu CI job) with Python's development mode (python -X dev, or PYTHONDEVMODE=1 so that tool scripts started as subprocesses are covered too). Dev mode enables ResourceWarning, which reports files, pipes and database connections that are never closed. The agent then traced each warning back to the code, did a static pass over the rest of the code, and wrote reproducers, which it ran on main at commit 79cd2b35f714274b60df4ef91e2f385c8e3d1197.
This is a tracking issue. The findings are split into two sub-issues, each with its own reproducers:
- #8122: unclosed files and pipes in tool scripts and Python modules. Small, independent leaks that should be easy to fix, in small PRs grouped by tool.
- #8123:
grass.temporalnever closes its SQLite connections. This is the largest source of warnings (over 3,000 in a full gunittest run), but it is not a one-line fix and needs a full temporal test run.
To reproduce
See the sub-issues. In general, set PYTHONDEVMODE=1 (and optionally PYTHONTRACEMALLOC=20 for the place where the object was opened) and run the Python tests or the gunittest testsuite.
Expected behavior
A run with PYTHONDEVMODE=1 prints no ResourceWarning from GRASS code.
Additional context
Once both sub-issues are fixed, the Python tests could run in CI with -X dev -W error::ResourceWarning, or at least report ResourceWarning, so new leaks are caught. Doing it before the grass.temporal issue is fixed would fail everywhere.
- Lingua principale
- C
- Stelle
- 1.2k
- Fork
- 447
- Merge medio
- 2g 10h
- PR unite (30g)
- 86
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OSGeo/grass
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] v.db.addtable expands $MAP only when it is a directoryForse già presa @alteralto l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] grass.pygrass: Cats.delete(0) deletes all layer categories instead of category 0Forse già presa @Mohit-Ak l’ha presa 40 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] macOS: Startup crashes with StopIteration when ~/Documents is not readable (macOS privacy protection)Forse già presa @NIne-WIngEd l’ha presa 46 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OSGeo/grass#8027 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Specify the test project nameForse già presa @Om23131212 l’ha presa 39 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
OSGeo/grass#7860 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
Revivedx/SavageWindRecomp#1358 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
ossc-db/pg_hint_plan#255 ·
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/aws-c-common#1319 ·
-
editor/integration
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DeusData/codebase-memory-mcp#3130 ·
I maintainer di solito rispondono entro 1 giorno