Skip to content

fix: clean error instead of std::terminate when writing tiles fails (#824) - #954

Open
dktue wants to merge 1 commit into
systemed:masterfrom
dktue:fix/tile-write-errors
Open

dktue wants to merge 1 commit into
systemed:masterfrom
dktue:fix/tile-write-errors

Conversation

@dktue

@dktue dktue commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Any exception while writing tiles (SQLite error, disk full, bad_alloc, ...) escaped a thread-pool worker and called std::terminate ("terminate called recursively" when several threads hit it). The progress line usually overwrote the actual message.

  • Tile-writing workers catch exceptions; the first one is reported with its tile after pool.join() (Error writing tile z12/2132/1493: ...), remaining batches are skipped, exit code 255. Same pattern as fix: clean error instead of std::terminate on missing nodes and Lua errors (#843) #947 for the .pbf reading phase.
  • .mbtiles: the final COMMIT moves from ~MBTiles() (a throw there always terminates) to closeForWriting(), and closing the tileset reports errors. Before: on a full disk, tilemaker printed "Filled the tileset with good things" and then aborted. saveTile uses a unique_lock so the DB mutex isn't left locked on error.
  • The geometry lookups in the combine-lines/combine-polygons loops skip a missing object like the first lookup already does, instead of terminating.

Tested (Monaco, OpenMapTiles config):

  • output to a 400–550 KB tmpfs: master exits 134 (terminate), patched prints Error writing out.mbtiles: database or disk is full and exits 255
  • injected throw at z12: master terminate (134), patched Error writing tile z12/2132/1493: injected test failure (255)

Fixes #824 (the trigger there is unknown, but it will now be printed). May also explain #858.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conversion aborted with "terminate called recursively"

1 participant