Skip to content

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

@jerluc

Description

@jerluc

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsource:postgisRelating to the PostGIS backend source

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions