Skip to content

Error: pool is draining and cannot accept work #80

@springmeyer

Description

@springmeyer

Generic pool has one throw inside its code here where it does throw new Error('pool is draining and cannot accept work').

This is unhandled in tilelive-bridge currently: we don't have a try/catch around acquire here.

We either need to handle this with a try/catch or fix our usage of generic-pool to ensure this condition is never hit.

It looks like this condition started to be hit after dd0c5ef at least in the case of Mapbox Studio Classic. What appears to be happening is that in the Studio Classic source editor a new data file is added and tile requests are made to tilelive-bridge.getTile. At the same time Studio Classic also calls update() which triggers re-creating the pool (in fact debugging indicates update is called twice when a file is saved for unknown reasons at https://github.com/mapbox/mapbox-studio-classic/blob/00c1a4e316a945d45732d8204e794168ea64720c/lib/source.js#L176-L177). The pool then gets drained and the in-flight tile requests then hit the unhandled pool is draining and cannot accept work and the whole process goes down.

TODO:

  • spend more time confirming I'm understanding the above scenario right.
  • ponder if this bug is related to the need to have cbaa67d

/cc @BergWerkGIS @yhahn

Metadata

Metadata

Assignees

No one assigned

    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