Currently shellpipe_sync mechanism is essentially a blocking fork and as such freezes up the map UI by design. However, it would be helpful to allow shellpipe_sync scripts to be cancelable from within the UI. E.g. instead of using a blocking fork, shellpipe_sync would operate as a nonblocking fork.
The UI would be overlaid with gray or transparency and there would be a cancel button (and possibly also a counting timer for how long the shellpipe_sync operation has existed for). This would provide transparency for end users that things 'are still working as designed' while running shellpipe scripts and also enable end-users to cancel long-running scripts which don't return in adequate time.
This is relevant for when users put in requests with too large amounts of data (e.g. both for Nominatim/Overpass searches, and additionally for routing/Mobroute requests). The user should be able to 'back-out' and this let's the user more quickly experiment & debug with smaller requests before moving on to larger requests.
This work essentially is composed of two pieces:
- The zig work to implement a cancel button & logic etc. per above description. (Send SIGTERM on clicking cancel)
- Reworking the bundled shell scripts to respond to properly terminate spawned processes on SIGTERM. (Process SIGTERM and cleanup process group)
Nguyễn Gia Phong referenced this ticket in commit 1e9781c.
Nguyễn Gia Phong referenced this ticket in commit ff788ad.
Nguyễn Gia Phong referenced this ticket in commit adaa4ba.
Nguyễn Gia Phong referenced this ticket in commit ae6aa5c.