StationA / tilenol

Scalable, multi-backend geo vector tile server
MIT License
22 stars 6 forks source link

PostGIS source returns a string-only error on request cancellation #42

Open jerluc opened 3 years ago

jerluc commented 3 years ago

When a request is cancelled for a PostGIS-backed layer, this unexpectedly results in a 500 error being returned:

ERRO[0017] Tile request failed: pq: canceling statement due to user request (HTTP error 500)

Upon further investigation, it appears that the PostgreSQL library we use returns the opaque error string pq: canceling statement due to user request when a request is cancelled (e.g. when panning around quickly on the map), which is incorrectly being handled as an unexpected server error (500 error code).

While this is currently not impacting end use in map interfaces (since when a browser cancels a request, it discards/closes its receive socket), this is clearly bypassing some code that was written specifically to handle request cancellations which in turn may impact: