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:
/cc @BergWerkGIS @yhahn
Generic pool has one
throwinside its code here where it doesthrow new Error('pool is draining and cannot accept work').This is unhandled in tilelive-bridge currently: we don't have a try/catch around
acquirehere.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 callsupdate()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 unhandledpool is draining and cannot accept workand the whole process goes down.TODO:
/cc @BergWerkGIS @yhahn