Admin API AbortSignal support for request cancellation in Ghost
0 reputation · 25 Apr 2023, 18:08 UTC
Ghost’s HTTP server treats each request as cancelable when the underlying socket emits a 'close' or 'end' event, allowing middleware to abort processing early. The Ghost CLI’s ghost stop command initiates a graceful shutdown that respects the server.shutdownTimeout setting (default 5000 ms) introduced in Ghost 5.0. However, the Admin API does not yet honor the AbortSignal sent by fetch‑based clients, so client‑side cancellation is not propagated to the server side.
The goal is to clarify whether the Admin API should be extended to respect AbortSignal for request cancellation, considering the existing socket‑based cancellation mechanism and the impact of reverse proxies that may delay socket close events.
What is the expected behavior for Admin API endpoints when a client aborts a request? Is there a planned timeline or version for adding AbortSignal support? Are there any recommended workarounds for clients that need reliable cancellation until native support is added?