mmomtchev / node-gdal-async

Node.js bindings for GDAL (Geospatial Data Abstraction Library) with full async support
https://mmomtchev.github.io/node-gdal-async/
Apache License 2.0
133 stars 26 forks source link

When freeing an SQL results `gdal.Layer` on a busy `gdal.Dataset` the GC can block the event loop #7

Open mmomtchev opened 3 years ago

mmomtchev commented 3 years ago

gdal-async displays in the console: Sleeping on semaphore in garbage collector while destroying an SQL results layers, this is a known issue in gdal-async, event loop blocked for xxx µs

This is the unsolved remainder of #6 In the following situation:

In this case the GC would have to block and wait for the asynchronous operation to complete which would block the event loop - as SQL results are stored in the GDALDataset structure.

There is only one solution to that issue - Datasets containing SQL layers should always be protected from the GC until their parent Datasets are reclaimed.

I prefer to get feedback from people that are actually affected before implementing such a radical and sub-optimal solution.