fix: chunk-Generator NoneType-Bug behoben – kein Crash mehr am Generator-Ende
This commit is contained in:
parent
aaf499352b
commit
f6b30bb06c
4 changed files with 43 additions and 4 deletions
|
|
@ -100,8 +100,8 @@ Sources-Cache unter `./build/sources/` – bei Rebuild nicht löschen (spart Re-
|
||||||
Der Download läuft in einem eigenen Container – vollständig unabhängig von
|
Der Download läuft in einem eigenen Container – vollständig unabhängig von
|
||||||
SSH-Sessions und VS Code. Resume-fähig: bei Unterbrechung einfach neu starten.
|
SSH-Sessions und VS Code. Resume-fähig: bei Unterbrechung einfach neu starten.
|
||||||
|
|
||||||
**Ressourcen:** 16 Threads, 1 GB RAM-Limit (effektiv ~40 MB, chunk-basiertes Processing), 4 CPUs.
|
**Ressourcen:** 16 Threads, 1 GB RAM-Limit (~40 MB effektiv), 4 CPUs. `restart: on-failure`.
|
||||||
**Robustheit:** Download schreibt in `satellite.mbtiles.part` → Martin ignoriert diese Datei während des Downloads. Nach Abschluss automatische Umbenennung zu `satellite.mbtiles`. Bei OOM startet der Container automatisch neu (`restart: on-failure`).
|
**Robustheit:** Schreibt in `satellite.mbtiles.part`, Umbenennung nach Abschluss. Resume-fähig.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /mnt/services-data/rd13_tile_server
|
cd /mnt/services-data/rd13_tile_server
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
# Session 2026-06-14 – Satellite-Download Debugging
|
||||||
|
|
||||||
|
### Prompt 1
|
||||||
|
Wie ist hier der Stand des Containers? Ist er fertig mit dem Download?
|
||||||
|
|
||||||
|
### Antwort 1
|
||||||
|
59% – 3,3 Mio / 5,59 Mio Tiles, 17 GB .part-Datei, ETA ~7,8h. Stabil.
|
||||||
|
|
||||||
|
### Prompt 2
|
||||||
|
Geht das auch noch genauer? Ist das schon öfter passiert und wann ist er fertig?
|
||||||
|
|
||||||
|
### Antwort 2
|
||||||
|
`docker inspect`: RestartCount: 15. Logs zeigten `TypeError: cannot unpack non-iterable NoneType object`.
|
||||||
|
|
||||||
|
Root Cause: Chunk-Generator-Bug in `scripts/download-satellite.py`:
|
||||||
|
```python
|
||||||
|
# BUGGY:
|
||||||
|
chunk = [(z, x, y) for z, x, y in (next(coords, None) for _ in range(CHUNK)) if ...]
|
||||||
|
# liefert None wenn Generator erschöpft → TypeError beim Entpacken
|
||||||
|
```
|
||||||
|
|
||||||
|
Fix:
|
||||||
|
```python
|
||||||
|
# FIXED:
|
||||||
|
chunk = []
|
||||||
|
for _ in range(CHUNK):
|
||||||
|
coord = next(coords, None)
|
||||||
|
if coord is None:
|
||||||
|
break
|
||||||
|
chunk.append(coord)
|
||||||
|
```
|
||||||
|
|
||||||
|
Container wurde mit Fix neu gestartet. 17 GB .part-Datei ist sicher, Resume aktiv.
|
||||||
|
ETA bis Fertigstellung: ~2-3h nach Skip-Phase.
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# PROJECT_CONTEXT – rd13_tile_server
|
# PROJECT_CONTEXT – rd13_tile_server
|
||||||
|
|
||||||
**Letzte Aktualisierung:** 2026-06-13 – Satellit-Download läuft stabil: chunk-basiert (max 500 Futures, ~37MB RAM), restart:on-failure, .part-Datei. Martin gestoppt bis Fertigstellung.
|
**Letzte Aktualisierung:** 2026-06-14 – Chunk-Generator-Bug behoben (NoneType TypeError). Download läuft stabil, 17 GB .part, ~2-3h bis Fertigstellung. Martin gestoppt.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,12 @@ def main():
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=THREADS) as ex:
|
with ThreadPoolExecutor(max_workers=THREADS) as ex:
|
||||||
while True:
|
while True:
|
||||||
chunk = [(z, x, y) for z, x, y in (next(coords, None) for _ in range(CHUNK)) if (z, x, y) != (None, None, None)]
|
chunk = []
|
||||||
|
for _ in range(CHUNK):
|
||||||
|
coord = next(coords, None)
|
||||||
|
if coord is None:
|
||||||
|
break
|
||||||
|
chunk.append(coord)
|
||||||
if not chunk:
|
if not chunk:
|
||||||
break
|
break
|
||||||
futs = {ex.submit(do_tile, conn, z, x, y): 1 for z, x, y in chunk}
|
futs = {ex.submit(do_tile, conn, z, x, y): 1 for z, x, y in chunk}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue