Does CouchDB release server resources immediately upon client connection closure?
0 reputation · 26 Jun 2024, 20:51 UTC
CouchDB provides mechanisms to limit query duration via the timeout parameter in _find requests and the max_timeout server configuration. When these limits are reached, the server typically returns a 504 Gateway Timeout status.
However, there is uncertainty regarding the behavior of the server when a client terminates the HTTP connection abruptly before a timeout is reached. While the _active_tasks endpoint allows for the monitoring of ongoing operations, it does not offer a method to manually cancel a specific request.
It is unclear if a closed client socket consistently triggers the immediate termination of the associated server-side process or if the query continues to consume CPU and I/O resources until it naturally completes or hits a server-defined limit.
- Does CouchDB detect client-initiated connection closures to stop long-running queries?
- Under what conditions do these requests remain as orphaned processes on the server?