digidem / mapeo-map-server

Offline map style and tile server
MIT License
5 stars 2 forks source link

fix: avoid redundant attempt at deleting style when import worker timeout occurs #77

Closed achou11 closed 2 years ago

achou11 commented 2 years ago

Noticed while attempting to integrate into mapeo mobile, but when our message timeout expires, it cancels the Piscina task and attempts to delete the style if the worker never sent its first message to main thread. However, upon cancellation, the Piscina task also attempts to delete the style. This causes an undesirable unhandled error.

Now we defer the style deletion to the cancelled Piscina task and remove that logic from the message timeout handler (or maybe it should it be the other way around?). Ideally a test would be added simulating the worker timeout, but not entirely sure how to create that situation via a test, so left a comment for now.