CouchDB
  1. CouchDB
  2. COUCHDB-1310

'/_restart' closes request socket before sending a response

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1
    • Component/s: HTTP Interface
    • Labels:
      None
    • Environment:

      All platforms. Tested on Ubuntu 10.10.

    • Skill Level:
      New Contributors Level (Easy)

      Description

      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..." (http://tools.ietf.org/html/rfc2616#section-8.2.4). Any HTTP client that actually obeys this direction, would end up restarting the server multiple times.

      I have a patch that fixes this issue. I will attach it to this report.

      This issue may be related to COUCHDB-946 (https://issues.apache.org/jira/browse/COUCHDB-946).

        Activity

        J. Lee Coltrane created issue -
        J. Lee Coltrane made changes -
        Field Original Value New Value
        Attachment 0001-fixed-_restart-closes-socket-before-sending-request.patch [ 12499464 ]
        Randall Leeds made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            J. Lee Coltrane
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development