Consistency of request cancellation states across database providers
0 reputation · 22 Jan 2022, 20:11 UTC
Prisma Client allows for request cancellation by passing an AbortSignal via the AbortController API. This mechanism is intended to propagate the cancellation from the JavaScript layer to the Rust-based query engine to prevent resource leakage on the database server.
While the client-side signal triggers the cancellation process, the actual behavior and reporting of the cancelled state may vary depending on the underlying database provider's implementation of process termination.
What is the expected consistency of the error state returned to the client when a query is aborted across different providers, such as PostgreSQL versus MongoDB? Does the Prisma engine normalize the resulting exception, or does it expose provider-specific cancellation codes?