Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js render hangs when repeating request after glyph load failure #3169

Open
kudlav opened this issue Jan 22, 2025 · 0 comments
Open

Node.js render hangs when repeating request after glyph load failure #3169

kudlav opened this issue Jan 22, 2025 · 0 comments
Labels

Comments

@kudlav
Copy link
Contributor

kudlav commented Jan 22, 2025

Describe the bug

Platform: Node.js

Rendering a tile. When a request to an external glyph fails, render is cancelled and callback is called with an error (which is expected). Then, the render hangs up when requesting the same tile for the second time.

To Reproduce

Steps to reproduce the behavior:

  1. Render tile with a glyph that cannot be fetched
  2. Error is returned instead of a tile
  3. Render the same tile again
  4. Render process hangs

Expected behavior

An error should be returned even on the second try.

Code example

https://gist.github.com/kudlav/999d60086eaf206726680a0ea45f7ed5

Output

#1
Rendering...
Callbacking request for tiles/15/17697/11101.pbf
Callbacking request for fonts/external/0-255.pbf
MBGL_MESSAGE [ERROR]    Style: Failed to load glyph range 0-255 for font stack external: Unknown url
FAILED, err:  [Error: Unknown url]
#2
Rendering...

The second retry hangs even if the glyphs is available during the second retry.

Platform information (please complete the following information):

  • Operating System: Ubuntu 22.04.5 LTS
  • Platform (e.g. Node.js, Qt): Node.js v22.11.0 / Node.js v18.19.0
  • Version: 6.0.0

Bug Analysis

  1. First request flow:

    • renderStill -> onUpdate -> renderFrame -> createRenderTree returns nullptr
    • triggers glyph requests
    • glyph request fails
    • renderFinished called with error
    • Flow completes successfully
  2. Second request flow:

    • renderStill -> onUpdate -> renderFrame -> createRenderTree returns nullptr
    • NodeRequest destructors called
    • Process hangs, no renderFinished called

After createRenderTree returns nullptr in second attempt, the normal error handling path is not triggered, preventing renderFinished from being called.

@louwers louwers added the node label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants