couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Joseph Davis (Commented) (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1310) '/_restart' closes request socket before sending a response
Date Tue, 18 Oct 2011 00:32:10 GMT


Paul Joseph Davis commented on COUCHDB-1310:

I'd point out that _restart is really only meant for test code to get the server into a known
state. This patch merely hides the issue and doesn't really address the underlying problem,
namely, that init:restart is a hard core reset of the VM. If there are concurrent clients
accessing the server they will be just as exposed to the original problem. About the only
thing to do would be to figure out how to gracefully quit mochiweb before calling init:restart.
Its not out of the question, but we moved to this approach when the graceful one didn't work
as reliably.
> '/_restart' closes request socket before sending a response
> -----------------------------------------------------------
>                 Key: COUCHDB-1310
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 1.1
>         Environment: All platforms.  Tested on Ubuntu 10.10.
>            Reporter: J. Lee Coltrane
>            Priority: Minor
>             Fix For: 1.1
>         Attachments: 0001-fixed-_restart-closes-socket-before-sending-request.patch
>   Original Estimate: 0h
>  Remaining Estimate: 0h
> In 'couchdb_misc_handlers.erl', `handle_restart_req(...)` calls `couch_server_sup:restart_core_server()`
before sending the HTTP response.  This causes the current request's socket to be closed without
sending any response back to the client.  From the perspective of the HTTP client, the connection
is simply dropped - no response is ever received.  
> In addition to the obvious aesthetic problems here, the HTTP1.1 spec suggests a specific
(and non-desirable) client-side behavior for connections that drop like this. From RFC-2616
Section-8.2.4: "...if the client sees the connection close before receiving any status from
the server, the client SHOULD retry the request..." (
 Any HTTP client that actually obeys this direction, would end up restarting the server multiple
> I have a patch that fixes this issue. I will attach it to this report.
> This issue may be related to COUCHDB-946 (

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message