Skip to content

An export can stop waiting at once for an MBTiles tile that is pending but not being read #1801

Closed as not planned

Description

@Mavrick-F

What happens

render::render_placed, which layout exports use, sometimes returns an MBTiles tile layer as a gap ("some tiles were still on their way when the export stopped waiting…") a few milliseconds after it starts, with no read under way. Drawn again a few seconds later, the tile comes in about 18 ms.

This is what makes tests::archive_render_revision::a_reload_between_series_pages_refuses_the_engine_pdf_without_replacing_destination fail on main's Windows jobs and the nightly (#1776). archive_reload_refuses_spanning_exports_without_replacing_destination, in the same module, has failed the same way on Windows ARM.

Evidence

I ran the whole rustgis-engine lib tests repeatedly on GitHub's Windows runners (x64 and ARM64), with diagnostics added to that test:

  • It failed in 7 of 48 full runs, in 0 of 30 runs alone or with its own module, and never on Linux.
  • Always MBTiles, never PMTiles; both at the test's first render of the archive and at the render after the reload.
  • No cache::clear ran during the failing render (cache::clears() was unchanged).
  • The failing render took 3.8–12.9 ms, and cache::in_flight() was 0 after it. Drawn again 5 s later: credits present, in 17–20 ms.

Likely cause

render::complete waits with cache::wait_for_news_unless, which returns at once when in_flight() is 0, and six passes with nothing landed end the wait. So an export stops immediately whenever its tile is pending in the cache but no read for it is counted as under way. I haven't found which path leaves an MBTiles tile pending with nothing in flight under load. Two places I'd look in crates/tiles/src/cache.rs: land returning early for forgotten_since without forgetting the pending slot, and jobs released by release_unstarted.

Two fixes seem possible, and either might be enough: never leave a slot pending without a read counted; or have the wait treat "my tile is pending but nothing is in flight" as a reason to ask again rather than an idle pass.

Context: the wait loop came with #1188 and #1460, the MBTiles forgotten-file bookkeeping with #1440, release_unstarted with #1540, and the test with #1504.

I'm working on a fix.

Activity

  1. self-assigned this
    on Nov 11, 2026
  2. Mavrick-F commented on Nov 11, 2026

    @Mavrick-F
    MemberAuthor

    Duplicate of #1761, fixed by #1765: the MBTiles metadata read now counts in in_flight(), which is the cause found here.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions